2
votes

I am a beginner with Selenium. I user Selenium IDE 1.9.0 for recording website activity. For example I am trying to record some activity involving an online product creation. Consider the website "demo.soft2print.com/products.asp" Here, i click on any product. It opens an IFrame wherein i can design the product. Selenium IDE does not record anything from the point the IFrame has loaded(even loading of the IFrame). When viewed in the "Source" tab in Selenium IDE, the following is the last that has got recorded(i.e when i click on a product)

<tr>
<td>clickAndWait</td>
<td>css=a.productgrouplink</td>
<td></td>

Please help on how to proceed recording IFrame acitivity(loading and related acitivity in the IFrame) using the Selenium IDE. It would be nice if i get to know how to proceed with reference to the website i mentioned. Awaiting for some help.

2

2 Answers

3
votes

As what I had posted here.

Here's a solution that worked for me:

Scenario:

  1. Page loads with a JavaScript that adds an iframe to the DOM <iframe id="iframeId" />
  2. iframe loads
  3. Now I want to check for an element within the iframe <div id="divElement"></div>

Solution:

(Command > C, Target > T, Value > V) If I didn't include, it means leave it blank

  • C: open   |   T: /
  • C: waitForElementPresent   |   T: iframeId   |   V: 3000
  • C: waitForFrameToLoad   |   T: iframeId   |   V: 5000
  • C: selectFrame   |   T: iframeId
  • C: assertElementPresent   |   T: css=div#divElement
  • C: verifyElementPresent   |   T: css=div#divElement
0
votes

I know it's quite a bit later, however I found what I think is a simpler solution that works with selenium 2.5.0 (which apparently as of writing, has a known issue-bug causing it to not record iframe activity, see here : https://code.google.com/p/selenium/issues/detail?id=6180 ) Solution for me while running selenium IDE, was to simply open the iframe in a new tab, and recording worked, as follows:

  • right click on iframe you want to record actions on, from the menu
  • select -> this frame -> open in new tab
  • Selenium IDE should start recording actions ( woo hoo! )
  • ... do your stuff, click click type type etc
  • when finished, close tab, continue on main page, selnium ide should be ok?

I'm a sample size of 1, not seen much on google on this topic so this might not work for you. Please drop a comment either way to let others know? cheers, A