I'm trying to write a Selenium Testcase and started with the Selenium IDE in Firefox. The test is working quite fine there. Now I want to automate that test with Selenium Webdriver and exported the according JAVA class. Everything is setup and working fine so far (the Internet Explorer window is opening, the according page is displayed).
BUT: Selenium Webdriver does not find the element. I want to get the following element:
<div class="x-grid3-cell-inner x-grid3-col-instance/status" unselectable="on">Open</div>
and I have the following code:
WebElement openWorkItem = driver.findElement(By.xpath("//div[contains(text(),'Open')]"));
System.out.println(openWorkItem.getText());
In the testcase with Selenium IDE the statement is pretty much the same, and it is working:
<td>//div[contains(text(),'Open')]</td>
The only difference is, that the Selenium IDE is only available in Firefox, but in the end I want to have the test executed in IE with Selenium WebDriver.
Any help is very much appreciated.
==Update==
I executed driver.getPageSource() and now see that the HTML part I am looking for is not available because it seems to be located in an iFrame. Any ideas?
//div[text()='Open']?iframebefore you try to find the element.