0

i'm writing selenium-java test cases and use both the chrome and phantomjs driver,but some test cases run in chrome but not in phantomjs... it shows error element not visible\not found.

“browserName":"phantomjs" "version":"2.1.1" "driverName":"ghostdriver" "driverVersion":"1.2.0" "platform":"linux-ubuntu-64bit"

[ERROR - 2017-03-23T11:02:54.645Z] WebElementLocator - _handleLocateCommand - Element(s) NOT Found: GAVE UP. Search Stop Time: 1490266974603

phantomjs://platform/console++.js:263 in error

Michael
  • 3,093
  • 7
  • 39
  • 83
Prashant Palve
  • 132
  • 2
  • 11
  • Can you please provide some more information as: 1. What is your objective? 2. What are you trying to achieve? 3. What have you done still now? Show code. 4. What worked for you? 5. Where are you stuck? 6. Update the question with relevant HTML DOM. – undetected Selenium Mar 21 '17 at 06:08

1 Answers1

0

Try using webddriver wait.

  • Chrome might be running the JS and DOM construction faster.
  • Phantom might be rendering it differently.

These are common when jumping from browser to browser they render a bit different.

Try adding int he webdriver wait for. It tells the browser to poll the DOM every 200ms until the timer is finished to look for the element.

This is a good example on how to use it: WebDriver - wait for element using Java

Might not solve your problem, might just do it.

Community
  • 1
  • 1
NanoMage
  • 121
  • 7