Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
» FlexMonkium Download Not available under Gorillalogic site
Thu Dec 08, 2016 5:40 pm by bhanu.praveen

» Selenium Script issue
Tue Dec 06, 2016 9:48 pm by njain213

» Difference between QTP, Selenium and Silk test
Tue Dec 06, 2016 7:58 pm by jessicacyrus1

» Where does selenium script pick browser from
Tue Dec 06, 2016 1:52 pm by janbaskt

» Safari throws an HTTP ERROR: 404
Tue Dec 06, 2016 1:51 pm by janbaskt

» Access Denied Error in Selenium RC
Tue Dec 06, 2016 1:51 pm by janbaskt

» Automating Flex application through selenium webdriver
Fri Dec 02, 2016 2:06 pm by abhinay.krs

» Starting with Selenium, what is Selenium?
Mon Nov 28, 2016 4:00 pm by Foma

» Getting started with Selenium
Mon Nov 28, 2016 3:23 pm by Rebbelx

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Selenium 2 Webdriver cant find element by xpath after upgrading from firefox 3.6 to 5

View previous topic View next topic Go down

Selenium 2 Webdriver cant find element by xpath after upgrading from firefox 3.6 to 5

Post by hhoang on Tue Jul 26, 2011 11:34 pm

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:

Code:
  WebElement venueDescription = driver.findElement(By.xpath("//iframe[contains(@id,'Frame')]"));

  venueDescription.sendKeys("This is a description for the Venue");
Here's a copy of the HTML code i'm trying to test.
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

Back to top Go down

Re: Selenium 2 Webdriver cant find element by xpath after upgrading from firefox 3.6 to 5

Post by hhoang on Wed Jul 27, 2011 2:14 am

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:
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

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum