Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Well there are two different ways to handle this that I can think of. First clean up the css on the page so that you don't have two conflicting styles on the same element. Second my guess is you have some form of javascript enabling the select menu which is probably firing after your selenium test grabs the object and says that it's not visible. Try dropping a thread.sleep before you grab the code, just for testing purposes. If that resolves the issue then I would create a javascript that would look for document.readyState and if it were "complete" then I would start parsing the page with Selenium.</p> <p>------ EDIT ------</p> <p>Well to modify the DOM with selenium you need to use the JavascriptExecutor class and cast it to your WebDriver. After you do that then you can execute javascript from your selenium application on the page which means you can manipulate the DOM.</p> <p>Here's an example:</p> <pre><code>WebDriver driver; // Assigned elsewhere JavascriptExecutor js = (JavascriptExecutor) driver; js.executeScript("document.getElementById('//elementID').removeAttr('display');"); </code></pre> <p><a href="http://code.google.com/p/selenium/wiki/FrequentlyAskedQuestions" rel="noreferrer">http://code.google.com/p/selenium/wiki/FrequentlyAskedQuestions</a></p> <p><a href="http://selenium.googlecode.com/svn/trunk/docs/api/java/org/openqa/selenium/JavascriptExecutor.html" rel="noreferrer">http://selenium.googlecode.com/svn/trunk/docs/api/java/org/openqa/selenium/JavascriptExecutor.html</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload