Closed vladikoff closed 5 years ago
If I update to Selenium 3.3.1 and Geckodriver 0.15.0 I get:
Error: [POST http://localhost:4444/wd/hub/session/611d26b4-6217-4eaa-bbbe-98e5f0af8559/element/28/value / {"value":["s","i","g","n","i","n","0",".","9","4","7","7","3","6","1","0","7","2","7","8","6","1","5","2","@","r","e","s","t","m","a","i","l",".","n","e","t"]}] Expected [object Undefined] undefined to be a string
Build info: version: '3.3.1', revision: '5234b32', time: '2017-03-10 09:04:52 -0800'
System info: host: 'Vlads-MBP', ip: '192.168.1.144', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.12.4', java.version: '1.8.0_111'
Driver info: org.openqa.selenium.firefox.FirefoxDriver
Capabilities [{moz:profile=/var/folders/p7/39d7lczd60q26jjqg29z57w00000gn/T/rust_mozprofile.ZdZtPYQsPWNT, rotatable=false, timeouts={implicit=0, pageLoad=300000, script=30000}, pageLoadStrategy=normal, platform=ANY, specificationLevel=0, moz:accessibilityChecks=false, acceptInsecureCerts=false, browserVersion=53.0, platformVersion=16.5.0, moz:processID=46688, browserName=firefox, platformName=darwin}]
Session ID: d4d1378c-9ee2-454a-a0d4-472d0a7ee4dc
There might be some changes in the Spec for send keys. @jason0x43 Do you know if there is a way to get access to marionette logs while the Intern tests are running? I can never figure that one out :(
After the geckodriver issue addressed, there is a problem in feature detection
if (!('dynamicViewport' in capabilities)) {
testedCapabilities.dynamicViewport = session.getWindowSize().then(function (originalSize) {
return session.setWindowSize(originalSize.width, originalSize.height);
}).then(supported, unsupported);
}
Commenting this out gets the tests working...
Gah, it's annoying when feature tests break FF.
Ok, it looks like the issue is that geckodriver hangs when Leadfoot tries to do a window/x/size
call. The W3C standard (and geckodriver 0.16) use a window/x/rect
command instead, so in the long run we'll need to update Leadfoot to handle that (https://github.com/theintern/leadfoot/issues/108).
In the short run I'll push out an update to disable that check in FF 53+.
@jason0x43 meanwhile, I was wondering how do you get access to Marionette logs via Leadfoot? This way I can file better bug reports or forward those logs to the Selenium team
In theory, you'd pass verbose: true
as a tunnelOption for SeleniumTunnel, which will cause Selenium to output debug logs to stdout. Unfortunately, there appear to be a couple of problems with that at the moment. Another issue for the day... https://github.com/theintern/digdug/issues/43
The FF 53 issues are fixed with Leadfoot 1.7.2 (at least, the get/set window size function doesn't hang). The verbose flag is more functional in Dig Dug 1.6.4.
@jason0x43 I'm trying to debug this a bit. If you look at this post:
https://github.com/SeleniumHQ/selenium/issues/4664#issuecomment-328154261
How do we use the new FirefoxOptions class
via Intern?
Currently I use the config.capabilities.firefox_profile
but seems like that's the "legacy way" based on that comment.
Ok in case someone finds this the new firefoxOptions
seem to work by updating the following:
diff --git a/tests/intern.js b/tests/intern.js
index 67700a0..61b6915 100644
--- a/tests/intern.js
+++ b/tests/intern.js
@@ -78,20 +78,20 @@ function (intern, topic, firefoxProfile) {
// this tells SeleniumTunnel to download geckodriver
drivers: [{
name: 'firefox',
- version: '0.16.0'
+ version: '0.19.0'
}],
// version of Selenium
- version: '3.4.0'
+ version: '3.6.0'
}
};
-
+ config.capabilities['moz:firefoxOptions'] = {};
// to create a profile, give it the `config` option.
- config.capabilities.firefox_profile = firefoxProfile(config); //eslint-disable-line camelcase
+ config.capabilities['moz:firefoxOptions'].profile = firefoxProfile(config); //eslint-disable-line camelcase
if (args.firefoxBinary) {
- config.capabilities.firefox_binary = args.firefoxBinary; //eslint-disable-line camelcase
+ config.capabilities['moz:firefoxOptions'].binary = args.firefoxBinary; //eslint-disable-line camelcase
}
One issue I have is in FF56 I get: Missing 'handle' parameter
Error: [POST http://localhost:4444/wd/hub/session/89f3db64-29bf-1f4c-8e24-33cd4a6ba352/window / {"name":"newwindow"}] Missing 'handle' parameter
Build info: version: '3.6.0', revision: '6fbf3ec767', time: '2017-09-27T16:15:40.131Z'
System info: host: 'vladikoffs-MBP', ip: '192.168.1.41', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.13', java.version: '1.8.0_144'
Driver info: driver.version: unknown
at Test.signup [as test] <tests/functional/sync_v3_email_first.js:105:10>
Suite firefox on any platform - Firefox Desktop Sync v3 email first FAILED
Error: [POST http://localhost:4444/wd/hub/session/89f3db64-29bf-1f4c-8e24-33cd4a6ba352/window / {"name":"2147483680"}] Missing 'handle' parameter
Interesting. In the source for Selenium's FirefoxDriver it looks like the driver just takes the profile
value from moz:firefoxOptions
and converts it to a firefox_profile
capability, so I'm not sure why that step would be necessary.
@jason0x43 any ideas where name
and handle
get set for
Error: [POST http://localhost:4444/wd/hub/session/ab1cd1c6-3eb7-294e-ac4c-7c209307ff1e/window / {"name":"2147483649"}] Missing 'handle' parameter
With this code:
.getAllWindowHandles()
.then((handles) => {
console.log('handles', handles)
myHandle = handles[1];
})
.switchToWindow('2147483649')
I always get handles [ '2147483649', '2147483672' ]
but even if hardcode it it is still missing the handler
option.
Some refs: https://github.com/SeleniumHQ/selenium/pull/2718 and https://github.com/SeleniumHQ/selenium/pull/2718
Also why are the handles always the same names... 🤦♂️
That handle parameter for switchToWindow
is set in Leadfoot. I actually have a TODO there about the parameter name being changed to handle
in the WebDriver spec. At the time everything still used name
, but I guess geckodriver has switched over.
@jason0x43 ugh my bad, I searched for it but failed to find it :P
Also, it looks like moz:firefoxOptions
is mentioned in the geckodriver docs: https://github.com/mozilla/geckodriver/blob/master/README.md#firefox-capabilities. I need to mention that in Intern's/Leadfoot's docs...
@jason0x43 so besides that handle
fix, this scenario doesn't work anymore:
If a window is opened in an .execute
, example
function openWindow (url, name) {
var newWindow = window.open(url, name || 'newwindow');
})
return this.parent.execute(openWindow, [ url, windowName ]);
The call to .switchToWindow('newwindow')
will fail with:
NoSuchWindow: [POST http://localhost:4444/wd/hub/session/79fd23b4-8d34-7348-9b44-7ab9a87617a1/window / {"handle":"newwindow"}] Unable to locate window: newwindow
The workaround is
.getAllWindowHandles()
.then(handles => {
return this.remote.switchToWindow(handles[1])
})
I spent a while today (technically yesterday) testing various combinations of FF + geckodriver + Selenium + cloud service (see https://github.com/theintern/leadfoot/issues/126). FF is a bit of a mess right now. I'm going to push out another leadfoot update tomorrow morning that will include some fixes to improve FF compatibility, but anything less than FF 55 + gd 0.18.0 + Selenium 3.5.0 has issues with at least window sizing and positioning.
We switched the workaround to
-- .switchToWindow('newwindow')
++ .then(switchToWindow(1))
Regarding the window switching issue, WebDriver handles are opaque identifiers rather than window names. Unfortunately I'm not sure of a straightforward way to associate names with handles, so you either have to retain the handle to a window you open, or guess it from the list of handles returned by getAllWindowHandles
.
My default Firefox update to 53 and now the Intern tests are failing to start properly:
Does anyone have this working? I'm trying to find working
tunnelOptions
. This worked in FF50 to FF52