cisco-open-source / qtwebdriver

WebDriver implementation for Qt
https://github.com/cisco-open-source/qtwebdriver/wiki
198 stars 59 forks source link

about qtwebengine #31

Closed weditor closed 7 years ago

weditor commented 7 years ago

I read 5.6 WebEngine supports #15 and Build and run I just want some more information , is there a chromedriver included in qtwebdriver? why i cannot find it in source code or release binary. or the chrome webdriver support qtwebengine? how? Do you mean Qt WebEngine Developer Tools? Someone gives me a webbrowser program based on Qt WebEngine, I want to test it just like test a browser by selenium, not manual clicks. I thought a lot of ways, but not work. " Note 3. For webdriver support on QWebEngine, use the ChromeDriver included in QWebEngine" -- I just don't understand.

thanks for any information or solution.

hekra01 commented 7 years ago

Hi @weditor,

To clarify, there are 3 components:

is there a chromedriver included in qtwebdriver

No, there is no chromedriver included in QtWebDriver

or the chrome webdriver support qtwebengine? how?

In fact, it is the opposite. QtWebengine is based on chrome, and chrome inscludes ChromeDriver (in src/thirdparty directory)

Do you mean Qt WebEngine Developer Tools?

No, I mean the real chromedriver, which is providid by chrome

Note 3. For webdriver support on QWebEngine, use the ChromeDriver included in QWebEngine

QtWebengine is based on chrome and , and chrome includes chromedriver.

From this issue https://bugreports.qt.io/browse/QTBUG-35650, it looks like the guys from Qt finalized the integration of ChromeDriver with Qt.

So you will find chromedriver in the codebase of QtWebEngine, and if you build it you should be able to automate Qtwebengine.

weditor commented 7 years ago

@hekra01 thank you very very very .... much. This problem has troubled me for several days According to your suggestion, i tryed to let chromedriver to launch my browser instead of chrome. it worked. i found there is a binary_location option in selenium's ChromeOption, it will pass to capabilities['chromeOptions']['binary']. i need to set it to the path of my own browser.

from selenium import webdriver

browser_url = '/mnt/testbrowser' chromeOptions = webdriver.ChromeOptions() chromeOptions.binary_location = browser_url driver = webdriver.Remote('http://127.0.0.1:9515', desired_capabilities=chromeOptions.to_capabilities()) driver.get('http://www.baidu.com')`

the chromeOptions.to_capablilities() is. {'browserName': 'chrome', 'chromeOptions': {'args': [], 'binary': '/mnt/testbrowser', 'extensions': []}, 'javascriptEnabled': True, 'platform': 'ANY', 'version': ''} it seems that chromedriver could use to automate any chromium based browser