1

I have 3 iframes as below:

<iframe id="contentframe" name="content" src="images/loading.gif?RN=6.3_HF10" class="" scrolling="no" frameborder="0" onLoad="setTrailMargin();"></iframe>

<iframe id="linkTrailFrame" src='images/blank.gif?RN=6.3_HF10' name="linkTrailFrame" class="linkTrailFrame" scrolling="no" frameborder="0" allowTransparency="true"></iframe>

<iframe id="ChildMenuIFrm" src='images/blank.gif?RN=6.3_HF10' name="ChildMenuIFrame" class="SubObjectNavCollpase" scrolling="no" frameborder="0" marginwidth=0 marginheight=0 style="display::none"></iframe>

driver.switchTo().frame("id"); is working for the second and third iframe, but not working for the first iframe.

3

Are you switching to frames one by one? After every switch to one frame you have to come out to the main content before making a switch to the next frame

webdriver.switchto().Frame(<FirstFrame>);
webdriver.switchto().defaultcontent();
webdriver.switchto().Frame(<SecondFrame>);

you can learn more about Iframes here http://toolsqa.com/selenium-webdriver/handling-iframes-using-selenium-webdriver/

1
  • No I have to only go to in frame 1st. I have seen difference in iframe 1st is = onLoad="setTrailMargin();....I have no idea about it how to handle
    – Waseem
    Jun 20 '16 at 6:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.