Skip to content

Pre-built binaries for Windows version : WebDriver-win64-Qt5.7 ? #41

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ReijoSep opened this issue May 29, 2017 · 21 comments
Closed

Pre-built binaries for Windows version : WebDriver-win64-Qt5.7 ? #41

ReijoSep opened this issue May 29, 2017 · 21 comments

Comments

@ReijoSep
Copy link

https://github.com/cisco-open-source/qtwebdriver/releases/tag/WebDriver-cisco-cmt-1.3.3
There are pre-built binaries:
Linux-versions:
WebDriver-linux64-Qt5.7
WebDriver-linux64-Qt5.6
WebDriver-linux64-Qt5.5

But there is only: Windows version: WebDriver-win64-Qt5.5

I noticed that at first it became Linux version for new QT release and after it will be published Win version….

Questions:

  1. Could it be possible to get WebDriver-win64-QT5.7 version?
  2. Have you any estimation, what kind of delay is between Linux and Windows version of WebDriver pre-built binaries with newer QT release support? I don't know, how complex it is to compile Windows version after Linux version of QTwebdriver?
@hekra01
Copy link
Contributor

hekra01 commented May 29, 2017

Hi,

1-Updated the release with win binaries. Qt 5.6 & 5.7.
Note there is no Qtwebkit support for Qt >= 5.6.
If you goal is to automate Qtwebengine, use QtWebEngines ChromeDriver instead. See #31 (comment)

2-No release plan or roadmap per se. This project is in maintenance phase.
If you want to build from source for specific platform, instructioen are here: https://github.com/cisco-open-source/qtwebdriver/wiki/Build-And-Run

@ReijoSep
Copy link
Author

Thanks! There are good instructions (2). If I understood correct, I should change/modify my env variables (path) to point QT environment QT 5.7... and Qtwebkit disabled -> build QTwebdriver project with Microsoft Visual Studio.

@hekra01
Copy link
Contributor

hekra01 commented May 29, 2017

If I understood correct, I should change/modify

Yes this is correct.
When using Qt >= 5.6, disable Qtwebkit by setting in wd_common.gypi:

    'WD_CONFIG_WEBKIT%': '0',

Then build.bat will create the wd.sln that you can open in MSVC and the build the exe.
I tested it with MSVC 2013 as qt/5.6 & 5.7 come with libs for this version

@ReijoSep
Copy link
Author

ReijoSep commented Jun 1, 2017

I have Windows 7 64-bit Operation System

I would like to test that my environment is ok "WebDriver_noWebkit.exe + QT5.7.0"and after I will build my QT application main.c with
#ifdef WD_TEST_APPL_SELENIUM
#include "Headers.h"
#endif /* WD_TEST_APPL_SELENIUM */

#ifdef WD_TEST_APPL_SELENIUM
wd_setup(argc, argv);
#endif /* WD_TEST_APPL_SELENIUM */

and I will add my application configuration file:
#define WD_TEST_APPL_SELENIUM
#define WD_ENABLE_WEB_VIEW 1
#define QT_NO_SAMPLES

I tried to use pre-binary from WebDriver-win-Qt5.7-cisco-cmt-1.3.3.zip.zip
from https://github.com/cisco-open-source/qtwebdriver/releases/

  1. I installed QT from http://download.qt.io/official_releases/qt/5.7/5.7.0/
  2. I run qtenv2.bat
    Command Prompt window:
    C:\Qt\Qt5.7.0\5.7\msvc2015_64\bin>qtenv2.bat vsvars
    C:\Qt\Qt5.7.0\5.7\msvc2015_64\bin>echo off
    Setting up environment for Qt usage...
    Remember to call vcvarsall.bat to complete environment setup!
    Note! I didn't find vcvarsall.bat from my PC.
  3. I copied WebDriver_noWebkit to my QT-folder: C:\Qt\Qt5.7.0\5.7\msvc2015_64\bin
    Note! I tested already C:\Qt\Qt5.7.0\5.7\msvc2013_64\bin with same results.
  4. I tried to run WebDriver_noWebkit.exe
    I got Application error:
    kuva

What should I do next?
Should I modify some configuration file and build own version from WebDriver_noWebkit.exe with my own configuration? Or is it possible to verify QT environment with WebDriver_noWebkit.exe without QT application?
https://github.com/cisco-open-source/qtwebdriver/wiki/Build-And-Run

@hekra01
Copy link
Contributor

hekra01 commented Jun 1, 2017

The binaries uploded were 32 bits.
To run binaies (regardless 32/64) open a Qt command prompt, (from Programs/Qt/5.7/MSVC2013 (32bit)) and run the exe from there

@ReijoSep
Copy link
Author

ReijoSep commented Jun 1, 2017

Thanks. Now I got:
kuva

  1. What does it mean: Remeber to call vcvarsall.bat to complete environment setup?
    Should I do any other settings?

I got also webdriver.log text document. It looks that server starts OK...:
[13140793176.579][SEVERE]: Root './web' does not exist!

[13140793176.583][INFO]: *** Webdriver ****
Version: WebDriver-cisco-cmt-1.3.3
Build Time: May 29 2017 17:08:43

[13140793176.592][INFO]: Server::Start()

[13140793176.592][FINE]: >>>>>>>>>>>>> Server::Start routes: >>>>>>>>>>>

[13140793176.592][FINE]: /status

[13140793176.592][FINE]: /log

[13140793176.592][FINE]: /session

[13140793176.592][FINE]: /session/*

[13140793176.592][FINE]: /sessions

[13140793176.592][FINE]: /session/*/timeouts

[13140793176.592][FINE]: /session/*/timeouts/async_script

[13140793176.592][FINE]: /session/*/timeouts/implicit_wait

[13140793176.592][FINE]: /session/*/log/types

[13140793176.592][FINE]: /session/*/log

[13140793176.592][FINE]: /session//window//size

[13140793176.592][FINE]: /session//window//position

[13140793176.592][FINE]: /session//window//maximize

[13140793176.592][FINE]: /session/*/title

[13140793176.592][FINE]: /session/*/forward

[13140793176.592][FINE]: /session/*/back

[13140793176.592][FINE]: /session/*/refresh

[13140793176.592][FINE]: /session/*/screenshot

[13140793176.592][FINE]: /session//element//screenshot

[13140793176.592][FINE]: /session/*/keys

[13140793176.592][FINE]: /session//element//click

[13140793176.592][FINE]: /session//element//hover

[13140793176.592][FINE]: /session/*/click

[13140793176.592][FINE]: /session/*/doubleclick

[13140793176.592][FINE]: /session/*/buttondown

[13140793176.592][FINE]: /session/*/buttonup

[13140793176.592][FINE]: /session/*/moveto

[13140793176.592][FINE]: /session/*/wheel

[13140793176.592][FINE]: /session//element//clear

[13140793176.592][FINE]: /session//element//value

[13140793176.592][FINE]: /session//element//submit

[13140793176.592][FINE]: /session//element//text

[13140793176.592][FINE]: /session//element//name

[13140793176.592][FINE]: /session//element//selected

[13140793176.592][FINE]: /session//element//enabled

[13140793176.592][FINE]: /session//element//displayed

[13140793176.592][FINE]: /session//element//location

[13140793176.592][FINE]: /session//element//location_in_view

[13140793176.592][FINE]: /session//element//size

[13140793176.592][FINE]: /session//element//attribute/*

[13140793176.592][FINE]: /session//element//css/*

[13140793176.592][FINE]: /session//element//equals/*

[13140793176.592][FINE]: /session/*/element

[13140793176.592][FINE]: /session/*/elements

[13140793176.592][FINE]: /session//element//element

[13140793176.592][FINE]: /session//element//elements

[13140793176.592][FINE]: /session/*/frame

[13140793176.592][FINE]: /session/*/element/active

[13140793176.592][FINE]: /session/*/window_handle

[13140793176.592][FINE]: /session/*/window_handles

[13140793176.592][FINE]: /session/*/window

[13140793176.592][FINE]: /session/*/source

[13140793176.592][FINE]: /session/*/url

[13140793176.592][FINE]: /session/*/execute

[13140793176.592][FINE]: /session/*/execute_async

[13140793176.592][FINE]: /session/*/application_cache/status

[13140793176.592][FINE]: /session/*/browser_connection

[13140793176.592][FINE]: /session/*/alert_text

[13140793176.592][FINE]: /session/*/accept_alert

[13140793176.592][FINE]: /session/*/dismiss_alert

[13140793176.592][FINE]: /session/*/cookie

[13140793176.592][FINE]: /session//cookie/

[13140793176.592][FINE]: /session/*/local_storage

[13140793176.592][FINE]: /session//local_storage/key/

[13140793176.592][FINE]: /session/*/local_storage/size

[13140793176.592][FINE]: /session/*/session_storage

[13140793176.592][FINE]: /session//session_storage/key/

[13140793176.592][FINE]: /session/*/session_storage/size

[13140793176.592][FINE]: /session/*/location

[13140793176.592][FINE]: /session/*/touch/click

[13140793176.592][FINE]: /session/*/touch/down

[13140793176.592][FINE]: /session/*/touch/up

[13140793176.592][FINE]: /session/*/touch/move

[13140793176.592][FINE]: /session/*/touch/scroll

[13140793176.592][FINE]: /session/*/touch/doubleclick

[13140793176.593][FINE]: /session/*/touch/longclick

[13140793176.593][FINE]: /session/*/touch/flick

[13140793176.593][FINE]: /session/*/orientation

[13140793176.593][FINE]: /xdrpc

[13140793176.593][FINE]: /session//element//-cisco-player-element/state

[13140793176.593][FINE]: /session//element//-cisco-player-element/volume

[13140793176.593][FINE]: /session//element//-cisco-player-element/seek

[13140793176.593][FINE]: /session//element//-cisco-player-element/mute

[13140793176.593][FINE]: /session//element//-cisco-player-element/speed

[13140793176.593][FINE]: /session/*/-cisco-visualizer-source

[13140793176.593][FINE]: /session/*/-cisco-visualizer-show-point

[13140793176.593][FINE]: /session/*/touch/-cisco-pinch-zoom

[13140793176.593][FINE]: /session/*/touch/-cisco-pinch-rotate

[13140793176.593][FINE]: /-cisco-shutdown

[13140793176.593][FINE]: /shutdown

[13140793176.593][FINE]: <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

@hekra01
Copy link
Contributor

hekra01 commented Jun 1, 2017

Yes, you're all set and can use wd

What does it mean: Remeber to call vcvarsall.bat to complete environment setup?

No need if you run from Qt command prompt

@ReijoSep
Copy link
Author

ReijoSep commented Jun 2, 2017

Where will I find example project for Windows QT application? It looks that it is not so easy to setup with QTwebdriver...
I tried to use QT5.7 : C:\Qt\Examples\Qt-5.7\designer\calculatorform.

kuva

I build clean example and I run it with debugger. It works OK.
But if I tried to modify calculatorform application with QTwebdriver settings, I can't compile it...
I tried to make modifications:

Option 1: WebDriver attaches to the running application
Pros:
Easy to setup
The application lifecycle is not impacted. It starts as it should, not on request of WebDriver
Cons:
Need to modify the application code in order to run WebDriver. But a such additional code can be flagged for test build only.

Instructions:
Add the QtWebDriver headers and libraries in the application build environment
Question 1: Could I find somewhere Windows QT example application project with these files and all configuration changes? I would like to know that my setup is OK.... and I could compare my project against working project with QTwebdriver
In the application code, include the headers: Headers.h
Question 2: I added Headers.h file, but it will be needed to add a lot of other headers files to Windows QT application, am I right?
Call the wd_setup(argc, argv) function with the parameters you want (See full argument list: Command Line Switches)
In your application's build system set appropriate #defines for features required from QtWebDriver (e.g. to add support for QWebView define WD_ENABLE_WEB_VIEW=1, to disable sampling define QT_NO_SAMPLES with any value). This is necessary because these values are used in Headers.h which is compiled into your application.
Rebuild an run your application, this will start QtWebDriver
Question 3: My project does't find all files.... and a lot of undefined references errors... I tried to integrate QTwebdriver to example project: C:\Qt\Examples\Qt-5.7\designer\calculatorform. Should I do any other changes to my QT project?
Connect your Selenium session to the QtWebDriver server running inside your application, e.g. in Java:

WebDriver driver = new RemoteWebDriver(new URL("http://192.168.24.1:9517"), capabilities);
System.out.println("Native page source:\n" + driver.getPageSource());
WebElement elt = driver.findElement(By.xpath("//QTextEdit"));

Note that we connect to it as a generic "remote" web driver rather than any particular browser.

@hekra01
Copy link
Contributor

hekra01 commented Jun 2, 2017

Question 1
Example option 1: cisco-open-source/qtbase#1
Expale option 2: #27

Check these examples, then let me know

Question 2 I added Headers.h file, but it will be needed to add a lot of other headers files to Windows QT application, am I right?

Not necessatry. Headers.h brings all the headers need by WD

@ReijoSep
Copy link
Author

ReijoSep commented Jun 2, 2017

If you check Headers.h:
There are
#include "base/at_exit.h"
#include "webdriver_server.h"
#include "webdriver_view_transitions.h"
#include "versioninfo.h"
#include "webdriver_route_table.h"
#include "commands/shutdown_command.h"
#include "webdriver_route_patterns.h"

I haven't these headers in example of QT5.7. If I tried to compile project : C:\Qt\Examples\Qt-5.7\designer\calculatorform .
My QT Creator QT application project doesn't find headers base/at_exit.h and so on...
I know that you have these files in QTwebdriver source.

Have you any example of Windows QT applicaton project with integrated QTwebdriver configuration ? Have you tried to compile it? If you send example QT project to me. I could open it with my QT Creator and I could try compile it.

@hekra01
Copy link
Contributor

hekra01 commented Jun 2, 2017

Have you any example of Windows QT applicaton project with integrated QTwebdriver configuration ? Have you tried to compile it? If you send example QT project to me. I could open it with my QT Creator and I could try compile it.

To all these questions, yes. Compiles and run. https://github.com/cisco-open-source/qtbase/pull/1/files
This example modifies qtbase/examples/widgets/mainwindows/mainwindow/main.cpp to add WD

If you do option 1 the WD libs an header are available.
Just modify your .pro to link with them . Sources and .pro example are in the PR in the link above

@ReijoSep
Copy link
Author

ReijoSep commented Jun 5, 2017

I sent private email with my QT example source code to you (hekra01) Could you double-check these files, please? I don't find reason, what does it go wrong?

@hekra01
Copy link
Contributor

hekra01 commented Jun 7, 2017

I'll look into it
In the meantime you can try on your side.

  • build WD from source on windows,to get the libs (will be in release mode). This is required since you will need to link the the libs. On Windows, build.bat will create a msvc project in out\wd.sln that can then be built in ms visual studio.
  • Import WD external libs you just built in Qtcreator
  • Also include WD headers paths in qtcreator .pro
  • Link your app with these libs.

You can try on Linux directly with the example i provided previously, doing the same on win is just a matter of tools.

@ReijoSep
Copy link
Author

ReijoSep commented Jun 8, 2017

I used:
Microsoft Visual Studio Community 2017
Version 15.2 (26430.12) Release
VisualStudio.15.Release/15.2.0+26430.12
Microsoft .NET Framework
Version 4.6.01055

I tried to build WD: I got error: unresolved external symbol....

kuva

@hekra01
Copy link
Contributor

hekra01 commented Jun 8, 2017

msvc 2017 not supported by Qt 5.7
You should use mvsc compliant with the versions listed under c:\Qt\5.7\msvcXXX
I managed t build with msvc 2015 and 2013

@ReijoSep
Copy link
Author

ReijoSep commented Jun 9, 2017

Now I tried with MSVC 2015 32-bit (x86).

Microsoft Visual Studio Community 2015
Version 14.0.25431.01 Update 3
Microsoft .NET Framework
Version 4.6.01055

Installed Version: Community

Visual Basic 2015 00322-20000-00000-AA223
Microsoft Visual Basic 2015

Visual C# 2015 00322-20000-00000-AA223
Microsoft Visual C# 2015

Visual C++ 2015 00322-20000-00000-AA223
Microsoft Visual C++ 2015

Application Insights Tools for Visual Studio Package 7.0.20622.1
Application Insights Tools for Visual Studio

I got linker error:
kuva

@ReijoSep
Copy link
Author

ReijoSep commented Jun 9, 2017

I solved it. The problem was that some projects have been used wrong target platform version. 10.0.xxx
and I changed to all projects to 8.1. I double-checked C/C++ Additional Include Directories to point C:\Qt\5.7\msvc2015\include .

Next I can start to integrated QTWebDriver libraries to QT application project.

@ReijoSep
Copy link
Author

I tried to add WD libraries to my QT calculator project.

I installed qt-opensource-windows-x86-msvc2015-5.7.0 from https://download.qt.io/official_releases/qt/5.7/5.7.0/

QT Creator + WD driver libraries ( QT 5.7 MSVC2015 32bit ):
Now I got lot of LNK2019 errors: I don’t know, how I will find solution for this problem. I’m not so familiar with QT Creator.

main.obj:-1: error: LNK2019: unresolved external symbol "public: void __thiscall CommandLine::ParseFromString(class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const &)" (?ParseFromString@CommandLine@@QAEXABV?$basic_string@_WU?$char_traits@_W@std@@v?$allocator@_W@2@@std@@@z) referenced in function "int __cdecl wd_setup(int,char * * const)" (?wd_setup@@YAHHQAPAD@Z)

@Jiloc
Copy link

Jiloc commented Jul 26, 2017

same error here. Seems like a compatibility issue with qt because of the /Zc:wchar_t- configuration.
I avoided that problem that problem commenting the line

cmd_line.ParseFromString(::GetCommandLineW());

in Headers.h.

Instead I set the options i need directly using

cmd_line.AppendArg(argument);

Anyway a fix would be good.

By the way I am using Qt5.9.1.

@hekra01
Copy link
Contributor

hekra01 commented Jul 26, 2017

Done: 6aa0f01

@hekra01 hekra01 reopened this Jul 26, 2017
@Jiloc
Copy link

Jiloc commented Jul 27, 2017

thank you. It works on 5.9.1

@hekra01 hekra01 closed this as completed Jul 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants