Closed mwilc0x closed 2 years ago
Can you set w3c:true
and try again?
Hi @gravityvi , thanks for your response!
Where should the w3c:true
setting be? Currently the only w3c
setting I have is for selenium.chrome
:
'selenium.chrome': {
extends: 'selenium',
desiredCapabilities: {
browserName: 'chrome',
chromeOptions: {
w3c: false,
args: ['--headless'],
},
},
Also, a quick search and found this comment which seems to address the specific problem am still seeing.
this happens because Chrome still uses JsonWire for the time being, and so you'll still get {'ELEMENT': '…'} until they switch to WebDriver.
Am wondering if there is still some discrepancy with JsonWire and WebDriver with Chrome/Firefox?
so chrome with flag w3c:false
uses JsonWire protocol, while firefox does not support JsonWire anymore. By default chrome would use w3c:true
.
I see here the JsonWire responses matches what I am seeing when running with chrome currently.
I switched those to w3c:true
and checked that there is not any other w3c:false
but am still seeing the JsonWire response when debugging.
Is the format that is being returned for GeckoDriver (see below) the expected output that should be tested with going forward?
{
value: {
"element-6066-11e4-a52e-4f735466cecf": "6c47eead-5b9b-4297-a151-235d86e8d53c",
},
}
I was also thinking of upgrading nightwatch to v2, but we are using a gulp plugin that hasn't been updated in a while and I think I would need to re-write it as some things have changed. Is it advised to upgrade to v2 asap?
I have also noticed some othe quirks between chrome and firefox, like .submitForm() not working in Firefox as it was for chrome. It seems there is some mis-configuration somewhere, or maybe some other issues.
Ah! Ok, setting w3c:true
was correct :) sorry for the confusion!
desiredCapabilities: {
browserName: 'chrome',
chromeOptions: {
args: ['--headless'],
w3c: true
},
},
Is this the recommended way we should test going forward using WebDriver and not legacy JsonWire? Should we upgrade to v2?
I am going to mark this as closed for now.
The solution to get Chrome and Firefox in sync was setting w3c:true
for chrome
as mentioned in https://github.com/nightwatchjs/nightwatch/issues/2934#issuecomment-956287776.
@michaelwilcox upgrading to v2 is recommended, but there might be changes required in test scripts. You can refer this breaking changes
Hi,
This is similar to #2017.
Am seeing inconsistent output from call to element depending on if running with Chrome or Firefox. More details below on output, configuration, and test code.
I am a bit stumped on what changes I may need to make, or if this is something else. Any help, suggestions or advice would be greatly appreciated. Thank you!
Test Code
Output
Firefox
Chrome
Configuration
nightwatch.conf.js