Selenium 2 Webdriver cant find element by xpath after upgrading from firefox 3.6 to 5
Page 1 of 1 • Share •
Selenium 2 Webdriver cant find element by xpath after upgrading from firefox 3.6 to 5
I have a test which will click on a description box
and type in a quick description. Before upgrading Firefox, the test would work fine. Selenium 2 would click on the box and would type in the description. however, after upgrading to firefox, I'm now receiving an "unable to locate element" error. It seems like Selenium2 is clicking on the textarea(I can see the cursor blinking inside the box), but it's not actually typing anything in.
Here's a copy of the code I'm using in selenium2, using Java:
The first and third textareas are hidden, so i use the contains() to
select the second textarea. This was working fine until the update.

and type in a quick description. Before upgrading Firefox, the test would work fine. Selenium 2 would click on the box and would type in the description. however, after upgrading to firefox, I'm now receiving an "unable to locate element" error. It seems like Selenium2 is clicking on the textarea(I can see the cursor blinking inside the box), but it's not actually typing anything in.
Here's a copy of the code I'm using in selenium2, using Java:
- Code:
WebElement venueDescription = driver.findElement(By.xpath("//iframe[contains(@id,'Frame')]"));
venueDescription.sendKeys("This is a description for the Venue");
The first and third textareas are hidden, so i use the contains() to
select the second textarea. This was working fine until the update.
- Code:
<input id="cf_textarea1311363997499___Config" type="hidden" style="display:none" value="LinkBrowserURL=%2FCFIDE%2Fscripts%2Fajax%2FFCKeditor%2Feditor%2Ffilemanager%2Fbrowser%2Fdefault%2Fbrowser.html%3FConnector%3D..%2F..%2Fconnectors%2Fcfm%2Fconnector.cfm%26_cf_clientid%3D242D1F3D48B023DBFB61177D36938485&LinkUploadURL=%2FCFIDE%2Fscripts%2Fajax%2FFCKeditor%2Feditor%2Ffilemanager%2Fconnectors%2Fcfm%2Fupload.cfm%3F_cf_clientid%3D242D1F3D48B023DBFB61177D36938485&ImageBrowserURL=%2FCFIDE%2Fscripts%2Fajax%2FFCKeditor%2Feditor%2Ffilemanager%2Fbrowser%2Fdefault%2Fbrowser.html%3FType%3DImage%26Connec...e%3DImage%26_cf_clientid%3D242D1F3D48B023DBFB61177D36938485&FlashBrowserURL=%2FCFIDE%2Fscripts%2Fajax%2FFCKeditor%2Feditor%2Ffilemanager%2Fbrowser%2Fdefault%2Fbrowser.html%3FType%3DFlash%26Connector%3D..%2F..%2Fconnectors%2Fcfm%2Fconnector.cfm%26_cf_clientid%3D242D1F3D48B023DBFB61177D36938485&FlashUploadURL=%2FCFIDE%2Fscripts%2Fajax%2FFCKeditor%2Feditor%2Ffilemanager%2Fconnectors%2Fcfm%2Fupload.cfm%3FType%3DFlash%26_cf_clientid%3D242D1F3D48B023DBFB61177D36938485&AutoDetectLanguage=false&DefaultLanguage=en">
<iframe width="0" scrolling="no" height="0" frameborder="0" src="javascript:void(0)" style="position: absolute; z-index: 10000;">
<iframe width="0" scrolling="no" height="0" frameborder="0" src="javascript:void(0)" style="position: absolute; z-index: 10000;">
<iframe width="0" scrolling="no" height="0" frameborder="0" src="javascript:void(0)" style="position: absolute; z-index: 10000;">
<iframe width="0" scrolling="no" height="0" frameborder="0" src="javascript:void(0)" style="position: absolute; z-index: 10000;">
<iframe width="0" scrolling="no" height="0" frameborder="0" src="javascript:void(0)" style="position: absolute; z-index: 10000;">
<iframe width="0" scrolling="no" height="0" frameborder="0" src="javascript:void(0)" style="position: absolute; z-index: 10000;">
<iframe id="cf_textarea1311363997499___Frame" width="675" scrolling="no" height="200" frameborder="0" src="/CFIDE/scripts/ajax/FCKeditor/editor/fckeditor.html?InstanceName=cf_textarea1311363997499&Toolbar=BasicText">
<textarea id="cf_textarea1311363997499" name="description" style="display: none;"></textarea>

hhoang- Posts: 2
Join date: 2011-07-26
Re: Selenium 2 Webdriver cant find element by xpath after upgrading from firefox 3.6 to 5
So after playing around with Selenium2, i discovered that it wasn't working because the editor was in a seperate iFrame.
So i implemented the following code, and it works:
However, now i'm having trouble figuring out how to return to the main page, so that i continue testing.
Is there an easy way to do this?
So i implemented the following code, and it works:
- Code:
driver.switchTo().frame(driver.findElement(By.xpath("//iframe[contains(@id, 'Frame')]")));
driver.switchTo().frame(driver.findElement(By.xpath("//iframe")));
driver.findElement(
By.xpath(
"html/body/p"
)
).sendKeys("This is a description for the Venue");
However, now i'm having trouble figuring out how to return to the main page, so that i continue testing.
Is there an easy way to do this?
hhoang- Posts: 2
Join date: 2011-07-26
Similar topics» Find out what Is Great About Dell Desktops.
» Selenium 2 Webdriver cant find element by xpath after upgrading from firefox 3.6 to 5
» OpenQA.Selenium.NoSuchElementException : Unable to find element
» Failing to identify element using Selenium WebDriver
» Selenium Webdriver online training
» Selenium 2 Webdriver cant find element by xpath after upgrading from firefox 3.6 to 5
» OpenQA.Selenium.NoSuchElementException : Unable to find element
» Failing to identify element using Selenium WebDriver
» Selenium Webdriver online training
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
» sample webdriver code for php users
» which standalone server to use
» Dynamic Drop Down Selection
» It is possible to find list of all URL's exist in any web page in selenium ide
» It is possible to compare 2 same images in selenium IDE.
» how to compare 2 ULR's which is exist in same web page (View page source).
» Web Driver: Unable to click a link present inside the frame of a frameset
» Help me to get dynamicaly loaded options of dropdown in Selenium RC -Junit test case