Chromedriver works, but "phantomjs cannot find an element using css selector"

I am developing several end-to-end tests for my work, and it works for me and works with nightwatch.js via chromedriver. However, we want this launch to be performed on our servers, and therefore I wanted to be able to run it using phantomjs. Although the test runs without incident using chromedriver, Phantomjs gives the following error: "phantomjs cannot find an element using the css selector"

Any ideas? I tried the internet to solve, but to no avail.

+4
source share
2 answers

decates ": https://github.com/nightwatchjs/nightwatch/issues/243#issuecomment-94287511

, -, , XHTML? , phantomjs, spoofing , - phantomjs, ( Mac Chrome):

"desiredCapabilities": {
  "browserName": "phantomjs",
  "phantomjs.cli.args" : ["--ignore-ssl-errors=true"],
  "phantomjs.page.settings.userAgent" : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36"
}

, . , , , : http://www.httpuseragent.org/. :

// Mac Chrome 46
"phantomjs.page.settings.userAgent" : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36"

// Windows Chrome 46
"phantomjs.page.settings.userAgent" : "Mozilla/5.0 (Windows NT 6.3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36"

// Mac Firefox 42.0
"phantomjs.page.settings.userAgent" : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:42.0) Gecko/20100101 Firefox/42.0"

// Windows Firefox 42.0
"phantomjs.page.settings.userAgent" : "Mozilla/5.0 (Windows NT 6.3; rv:42.0) Gecko/20100101 Firefox/42.0"

// PhantomJS 2.0
"phantomjs.page.settings.userAgent" : "Mozilla/5.0 (Macintosh; Intel Mac OS X) AppleWebKit/538.1 (KHTML, like Gecko) PhantomJS/2.0.0 Safari/538.1"
+5

, . , ( ). .

waitForElementPresent/Visible.

+1

All Articles