Closed jmforum closed 7 years ago
I think I found something.
driver.SwitchTo().Window(driver.WindowHandles[0])
then driver.Url = "qtwidget://Browser"
and
driver.PageSource =
<?xml version="1.0" encoding="UTF-8"?>
<Browser elementId="797c83c693460fa990dbf0f97eb8dfad" className="Browser">
<QRubberBand id="qt_rubberband" elementId="dae106d13f4f42f03def754242ce597d" className="QRubberBand"/>
<QWidget id="centralWidget" elementId="5d62014b47008362fb29ac8a78e4f068" className="QWidget">
<QWidget id="vLayoutWidget" elementId="422819082c1d3ef1f6460e43ab7b9243" className="QWidget">
<QWidget id="hLayoutWidget" elementId="f65d086b1000ecdc65cac5a9caa58b1e" className="QWidget">
<QWebView id="webView" elementId="10868eaf1676e668296445ee1ff197ff" className="QWebView"/>
</QWidget>
</QWidget>
</QWidget>
</Browser>
but could not have the html source code of displayed web page
I think I found something.
after driver.SwitchTo().Window(driver.WindowHandles[0])
then driver.Url = "qtwidget://Browser"
and
driver.PageSource =
<?xml version="1.0" encoding="UTF-8"?>
<Browser elementId="0e6f52520ad325eb933c15d79543b3a1" className="Browser">
<QRubberBand id="qt_rubberband" elementId="3e182a7ea459541882ccbf34b46fcf1a" className="QRubberBand"/>
<QWidget id="centralWidget" elementId="7171f0cee2d4426c45014b796b155336" className="QWidget">
<QWidget id="vLayoutWidget" elementId="3b2b4f59609ea5d431a04e15d067cc50" className="QWidget">
<QWidget id="hLayoutWidget" elementId="ed80345b58ea149c4da5daf6d21154e3" className="QWidget">
<QWebView id="webView" elementId="9477c10ce497532333a09de1fea458ea" className="QWebView"/>
</QWidget>
</QWidget>
</QWidget>
</Browser>
but I couldn't have the html source page of web page current displayed.
Best regards
Long explanation: https://github.com/cisco-open-source/qtwebdriver/wiki/Hybridity-And-View-Management#hybrid-uis
Short : there are several windows; you need to select the correct one (not always [0]) to get the html. Check the code sample in the previous link
console log when execute GoToUrl command
This is normal. You need to select the correct view to open you url. select webview to open http, selectt widget view to open qtwidget, etc...
Hi hekra01, Thanks a lot for your reply.
I saw this link in my second post.
I have only 2 WindowHandle (one with url equals to qtwidget://QWidget
and other equals to qtwidget://Browser
) inside the first one PageSource equals
<?xml version="1.0" encoding="UTF-8"?>
<QWidget elementId="bc5d574374c1c73ad66778c8043ef875" className="QWidget"/>
But I don't understand who to select <QWebView id="webView" elementId="9477c10ce497532333a09de1fea458ea" className="QWebView"/>
JM
From the code you posted
driver.PageSource =
<?xml version="1.0" encoding="UTF-8"?>
<Browser elementId="0e6f52520ad325eb933c15d79543b3a1" className="Browser">
<QRubberBand id="qt_rubberband" elementId="3e182a7ea459541882ccbf34b46fcf1a" className="QRubberBand"/>
<QWidget id="centralWidget" elementId="7171f0cee2d4426c45014b796b155336" className="QWidget">
<QWidget id="vLayoutWidget" elementId="3b2b4f59609ea5d431a04e15d067cc50" className="QWidget">
<QWidget id="hLayoutWidget" elementId="ed80345b58ea149c4da5daf6d21154e3" className="QWidget">
<QWebView id="webView" elementId="9477c10ce497532333a09de1fea458ea" className="QWebView"/>
</QWidget>
</QWidget>
</QWidget>
</Browser>
You have 2 windowss:
To select the web view
qtwidget://..
our http://...
or https://...
Exmple of this is private String selectWindow(String protocol) {
in the code sample at https://github.com/cisco-open-source/qtwebdriver/wiki/Hybridity-And-View-Management#hybrid-uis
I agree with you but I have only 2 WindowHandles WindowHandles[0].Url = "qtwidget://QWidget" WindowHandles[1].Url = "qtwidget://Browser" But nothing starting with http
Can you paste you wd.gypi?
{
'variables': {
'QT5': '1',
'WD_CONFIG_QWIDGET_BASE': '0',
# If Qt >= 5.6 set 'WD_CONFIG_WEBKIT' : '0'
'WD_CONFIG_WEBKIT': '1',
'WD_CONFIG_QUICK': '0',
'WD_CONFIG_PLAYER': '0',
'WD_CONFIG_ONE_KEYRELEASE': '0',
'QT_INC_PATH': '/home/user/workspace/advantage_Integration/buildroot/outputPod/host/usr/arm-buildroot-linux-gnueabihf/sysroot/usr/include/qt5',
'QT_BIN_PATH': '/home/user/workspace/advantage_Integration/buildroot/outputPod/host/usr/bin/',
'QT_LIB_PATH': '/home/user/workspace/advantage_Integration/buildroot/outputPod/host/usr/arm-buildroot-linux-gnueabihf/sysroot/usr/lib'
},
}
hm, WD_CONFIG_QWIDGET_BASE should be 1, since you are using qtwidgets
It's works Thanks a lot
Dear all,
I use qtwebdriver on arm with the Option 1.
My app works fine, it's load web page correctly. But when use selenium in C# nothings append
driver.PageSource always equals to
console log when execute GoToUrl command
Do I miss something ?
Best Regards JM