Re: IFrame Issue

3,331 views
Skip to first unread message

Kevin O.

unread,
Apr 2, 2013, 10:00:07 AM4/2/13
to robotframe...@googlegroups.com
Wow thats a lot of frames.
You cannot locate elements inside a frame/iframe element without switching to it first, so you cannot locate an iframe element based on any content inside it.
//iframe[@id='iFrm']/html/frameset references elements inside an iframe
The frame element you need to select does have a name attribute.
Try
Select Frame    id=iFrm
Select Frame    name=main
Page Should Contain Element    xpath=//em[.='Print Vehicle Values']

Use Unselect Frame to go back to the topmost frame.
Note that you can't just tell Selenium to switch context to go one level up.
If you are two iframes deep, for instance, you have to do Unselect Frame and Select Frame to go up one level. It is quite a pain to have nested iframes.

Kevin

Kishore Thotapally

unread,
Apr 3, 2013, 4:23:41 AM4/3/13
to robotframe...@googlegroups.com

Kevin,

 

As per your code Select Frame   name=main

Before Selecting Frame ‘main’ they have anther set Frame Set, Please find the screen shot (2nd Yellow colour)

 

I tried set name=main also its  not working

 

Please give me any other solution

 

Regards,

Kishore


On Tuesday, 2 April 2013 18:39:36 UTC+5:30, Kishore Thotapally wrote:

Hi Guys,

 

I am unable to Identifying  Frame elements using Robot Framework

 

1)      When I am trying Identify by using  developer’s tool its look the attached screen shot hierarchy

2)      When I am using robot framework its Identifying first iframe value id is “iFrm”

Please find code :

Select Frame  iFrm

 

3)      After second hierarchy they have Frame Set there is no identification but I tried the following different codes  it’s not identifying

a)      Select Frame  //iframe[@id='iFrm']/html/frameset

b)      Another way I used  Select Window  //em[contains(text(),'Print Vehicle Values')]

  

Tried all the ways but still not identify the elements. Please let me know  how to identify frames in Robot Frame work

 

More details please find the attached screen shot
 
Regards,
Kishore

Kevin O.

unread,
Apr 3, 2013, 9:36:23 AM4/3/13
to robotframe...@googlegroups.com
Not sure what the problem is. The frameset holder should not affect things. What libraries are you using?
Another possibility is that you are attempting to select a frame before it exists. The iframe with id iFrm does not have a src attribute so it must be inserted via JavaScript. One thing to try is putting this before the Select Frame     name=main, put:
Wait Until Page Contains Element    name=main
Also note that there is no restriction that names are unique, so you might try a more specific locator like:
xpath=//frame[@name='main']

I created html fragments of your app and served up on a local web server. I have attached a test, log, and html files.
The test passes on IE8 & FF10 using Selenium2Library 1.1 & Selenium 2.21.3

Good luck,
Kevin

frames.zip

Ed Manlove

unread,
Apr 5, 2013, 9:59:05 AM4/5/13
to robotframe...@googlegroups.com
Vinod,

Not sure adding tag=iframe is the best solution especially putting into _browsermanagement.py; most of the element locator code is within src/Selenium2Library/locators/elementfinder.py.

Kishore , what version of Selenium2Library are you using? Make sure you have only the latest 1.1.0 as there was a fix for frame/iFrame selection within the latest version.

Ed

On 04/04/2013 03:10 AM, Vinod Kutani wrote:
Hi Kishore,

Go to def select_frame in C:\Python27\Lib\site-packages\Selenium2Library\keywords\browsermanagement(python file) and add tag=iframe.
Probably it will work.

Thanks,
Vinod�


On Tuesday, 2 April 2013 18:39:36 UTC+5:30, Kishore Thotapally wrote:

Hi Guys,

�

I am unable to Identifying �Frame elements using Robot Framework

�

1)����� When I am trying Identify by using� developer�s tool its look the attached screen shot hierarchy

2)����� When I am using robot framework its Identifying first iframe value id is �iFrm�

Please find code :

Select Frame� iFrm

�

3)����� After second hierarchy they have Frame Set there is no identification but I tried the following different codes� it�s not identifying

a)����� Select Frame� //iframe[@id='iFrm']/html/frameset

b)����� Another way I used �Select Window� //em[contains(text(),'Print Vehicle Values')]

��

Tried all the ways but still not identify the elements. Please let me know� how to identify frames in Robot Frame work

�

More details please find the attached screen shot
�
Regards,
Kishore


Reply all
Reply to author
Forward
0 new messages