cisco-open-source/qtwebdriver

ExecuteScriptImpl -> not executed

stefdaems opened this issue · 9 comments

If often do not see following loglines appearing in the webdriver log whenever a new session is being created:

[13105710110.486][FINE]: ExecuteScriptImpl - {"status":0,"value":""}
[13105710110.486][FINE]: GetWindowName -
[13105710110.486][INFO]: Session(8894f878c5ab9b69e7407a40f3ed62a6) view: 06e8bd4cbd1420d6f56fa772799ab819
[13105710110.486][FINE]: Graphics Web executor for view(06e8bd4cbd1420d6f56fa772799ab819)
[13105710110.486][FINE]: start view (06e8bd4cbd1420d6f56fa772799ab819)
[13105710110.487][INFO]: SwitchTo - set current view (06e8bd4cbd1420d6f56fa772799ab819)
[13105710110.488][FINE]: Graphics Web executor for view(06e8bd4cbd1420d6f56fa772799ab819)
[13105710110.496][FINE]: ExecuteScriptImpl - {"status":0,"value":{"left":0,"top":0,"width":1280,"height":720}}

As the ExecuteScriptImpl - lines do not show up I'm getting following errors on sending requests:

[13105709186.167][INFO]: no root element specified, search from root.
[13105709186.168][WARNING]: unsupported locator - css
[13105709186.168][WARNING]: unsupported locator - css
[13105709186.168][WARNING]: unsupported locator - css
[13105709186.168][WARNING]: unsupported locator - css
[13105709186.168][WARNING]: unsupported locator - css
[13105709186.169][WARNING]: Command finished (/session/db50c3a43c473e299c1e0f24ac72db23/element) with response {
"sessionId": "db50c3a43c473e299c1e0f24ac72db23",
"status": 7,
"value": {
"message": "The element could not be found"
}
}

It doesn't seem to happen continuously, but very often this is noticed ( 1 out of 15 ).

hm, could you share your selenium code?

SeleniumQT.prototype.createSession = function() {
var url = "http://" + this.targetIP + ":" + this.targetPort + "/session"
var data =
"{"desiredCapabilities":{"reuseUI":true,"browserStartWindow":"*"}}"
var host = this.targetIP + ":" + this.targetPort
var options = { headers: { "Accept": "application/json, image/png",
"Content-Type": "application/json;charset=utf-8",
"Host": + host,
"Connection": "Keep-Alive"
}};
needleConn.post(url, data, options, function(err,resp) {
console.log(resp.body);
sessionNr = resp.body.value;
});
}

This is the code I'm using to create the session.

2016-04-21 15:27 GMT+02:00 hekra01 notifications@github.com:

hm, could you share your selenium code?


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#16 (comment)

var needleConn = require("needle");

I'm using needle for node.js

hm, just an advice, maybe there is a simpler way by using Webdriver js: https://github.com/SeleniumHQ/selenium/wiki/WebDriverJs
YOu won't need to code all the http requests youself

We also did a fork of webdriverjs to add some changes (https://github.com/cisco-open-source/qtwebdriver/wiki/WebDriverJS), but the official version metioned above should work fine for you.

I want to understand why the error is not happening always but only sometimes.

I'm using the jsonwireprotocol and its /session post-request to create a new session with the correct header. Often the ExecuteScriptImpl is just not starting and resulting in the unsupported locator messages.
Whenever I execute the same request again, the ExecuteScriptImpl is showing up.

IMHO it is not related to the request I'm sending.

You're using QGraphicsWebViews, I think this happens:

  • In all cases the session is created
  • browserStartWindow=* means the WD will select the first found window.
    • if it is the QGraphicsWebView, all good.
    • if it is one of its parent widgets, then your css requests will fail
  • To make it sure, after creating the session, you should select the GraphicsWebView by:
    • iterating on the windows
    • select the one with http content

Details and example here: https://github.com/cisco-open-source/qtwebdriver/wiki/Hybridity-And-View-Management#hybrid-uis

Can I directly target one with http content using

browserStartWindow="http"

?

Op 21 apr. 2016 om 17:50 heeft hekra01 notifications@github.com het volgende geschreven:

You're using QGraphicsWebViews, I think this happens:

In all cases the session is created
browserStartWindow=* means the WD will select the first found window.
if it is the QGraphicsWebView, all good.
if it is one of its parent widgets, then your css requests will fail
To make it sure, after creating the session, you should select the GraphicsWebView by:
iterating on the windows
select the one with http content
Details and example here: https://github.com/cisco-open-source/qtwebdriver/wiki/Hybridity-And-View-Management#hybrid-uis


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub

You can use browserStartWindow=myWindowName
From what you describe you lanch your application before creating a session, so if you know the tiltle of the web page that is open in your QGraphicsWebView, then you can attmept to select it with browserStartWindow.
Otherwise, widow selection as described above is the only way

Previous answser should fix this. Let me know if other issues.