FAQ
I have a page where a popup is created through iFrames.

- I use switchTo().frame("LookupWindow") to switch to the popup.
- I then successfully enter some text and look up a value
- Once the value is found, I click on on it (still on the popup)
- The popup now closes (because I clicked on the value in the popup)

This all works fine.

I then execute switchTo().defaultContent()

This is where webdriver hangs and never returns. No error message, nothing.

Ideas? Workarounds?

Thanks.

--
You received this message because you are subscribed to the Google Groups "webdriver" group.
To view this discussion on the web visit https://groups.google.com/d/msg/webdriver/-/IRX8dc1GWnoJ.
To post to this group, send email to webdriver@googlegroups.com.
To unsubscribe from this group, send email to webdriver+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/webdriver?hl=en.

Search Discussions

  • Phil at Oct 30, 2012 at 12:43 pm
    I'm having a similar issue where I can access the iframe and click it's
    contents no problem but because it closed itself before I get a chance to
    call switchTo().
    defaultContent() I cannot access the same frame again. Any help would be
    greatly appreciated.

    Phil

    --
    You received this message because you are subscribed to the Google Groups "webdriver" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/webdriver/-/8vXD6utmyaIJ.
    To post to this group, send email to webdriver@googlegroups.com.
    To unsubscribe from this group, send email to webdriver+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/webdriver?hl=en.
  • Santosh Hulisandra Srikanta at Oct 30, 2012 at 4:35 pm
    instead of using driver.switchTo().defaultContent() use
    driver.switchTo().window("window name") i have the same scenario and
    driver.switchTo().window() works for me.
    On Tue, Oct 30, 2012 at 6:07 PM, Phil wrote:

    I'm having a similar issue where I can access the iframe and click it's
    contents no problem but because it closed itself before I get a chance to
    call switchTo().
    **defaultContent() I cannot access the same frame again. Any help would
    be greatly appreciated.

    Phil

    --
    You received this message because you are subscribed to the Google Groups
    "webdriver" group.
    To view this discussion on the web visit
    https://groups.google.com/d/msg/webdriver/-/8vXD6utmyaIJ.

    To post to this group, send email to webdriver@googlegroups.com.
    To unsubscribe from this group, send email to
    webdriver+unsubscribe@googlegroups.com.
    For more options, visit this group at
    http://groups.google.com/group/webdriver?hl=en.


    --

    /Santosh

    --
    You received this message because you are subscribed to the Google Groups "webdriver" group.
    To post to this group, send email to webdriver@googlegroups.com.
    To unsubscribe from this group, send email to webdriver+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/webdriver?hl=en.
  • Darrell at Oct 31, 2012 at 2:02 am
    This is an odd one. I worked for someone who abused iframes and popup
    windows. I definitely had a point where I would click something in the
    default iframe which would pop open a window. I'd then select something
    from the popup and it would close the popup. I then switched to
    defaultContent().

    I was using an older version of Selenium. It was this year however.
    Selenium 2.18.0 or something. So it is possible this stopped working at
    some point but I'm doubtful.

    The other possibility is you are doing something else which 'works' but
    causes Selenium to fail further down the scenario. I would try to reduce
    the problem to the minimum lines of code. For example, one application
    would require:


    1. Login
    2. Find and click element
    3. Find the popup and switch to it
    4. Select a value from the popup
    5. Switch to defaultContent()
    6. Assert

    Most often the act of reducing the problem to a snippet I could post here
    (or file with a defect report if it was an application defect) I would
    learn some new things and figure out the real problem myself.

    Darrell

    On Monday, 29 October 2012 07:52:26 UTC-7, Rino van Dam wrote:

    I have a page where a popup is created through iFrames.

    - I use switchTo().frame("LookupWindow") to switch to the popup.
    - I then successfully enter some text and look up a value
    - Once the value is found, I click on on it (still on the popup)
    - The popup now closes (because I clicked on the value in the popup)

    This all works fine.

    I then execute switchTo().defaultContent()

    This is where webdriver hangs and never returns. No error message,
    nothing.

    Ideas? Workarounds?

    Thanks.
    --
    You received this message because you are subscribed to the Google Groups "webdriver" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/webdriver/-/kltQQ3kXNncJ.
    To post to this group, send email to webdriver@googlegroups.com.
    To unsubscribe from this group, send email to webdriver+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/webdriver?hl=en.
  • Alexei Barantsev at Oct 31, 2012 at 7:17 am
    Hi, all,

    On the one side, there is a test
    FrameSwitchingTest.testShouldBeAbleToCarryOnWorkingIfTheFrameIsDeletedFromUnderUs
    [1] in out test suite that passes in most browsers (except for andriod and
    opera) [2].

    On the other side, there is an issue #2703 [3] that contains a reproduction
    scenario, and I've cheched it still fails in Chrome:

    <code>
    import org.openqa.selenium.*
    import org.openqa.selenium.firefox.*
    import org.openqa.selenium.chrome.*

    driver = new ChromeDriver()

    driver.get("http://www.tinymce.com/tryit/full.php")

    tinymcesmileyPopupPluginLink =
    driver.findElement(By.cssSelector(".mceIcon.mce_emotions"));
    tinymcesmileyPopupPluginLink.click()

    //switch to iframe popup
    tinymcePopupFrame =
    driver.findElement(By.cssSelector("iframe[id^=\"mce\"]"))
    driver.switchTo().frame(tinymcePopupFrame)

    tinymcesmileyCoolIcon =
    driver.findElement(By.cssSelector("a>img[src='img/smiley-cool.gif']"))
    tinymcesmileyCoolIcon.click()

    //Chrome does a click but click does not RETURN.
    driver.switchTo().defaultContent()
    </code>

    Сonclusion 1: there is a bug in the chromedriver, but it is not general, it
    appears in some edge cases.

    Conclusion 2: chromedriver releases are rare and small issues can stay not
    fixed for long => you'd better look for a workaround.

    Regards,
    --
    Alexei Barantsev
    Software-Testing.Ru
    Selenium2.Ru

    --
    You received this message because you are subscribed to the Google Groups "webdriver" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/webdriver/-/f6t578uw3cwJ.
    To post to this group, send email to webdriver@googlegroups.com.
    To unsubscribe from this group, send email to webdriver+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/webdriver?hl=en.
  • Rino van Dam at Oct 31, 2012 at 12:48 pm
    Darrel, Alexei and others: thank you for your replies.

    First, I need to adjust my problem description. Since I wrote the first
    post, I have realized that webdriver actually hangs immediately after
    executing the code that closes the popup. It never gets to the line that
    switches back to the default content. So:

    - I use switchTo().frame("LookupWindow") to switch to the popup.
    - I then successfully enter some text and look up a value
    - Once the value is found, I click on on it (still on the popup)
    - The popup now closes (because I clicked on the value in the popup)

    This all works fine, but webdriver now hangs. It never gets to
    execute switchTo().defaultContent()

    Also: this is on Firefox 15.0.1, Selenium (java) 2.25.

    I have successfully used similar code (switchTo()... etc) in the past, but
    there the popup didn't close itself. I am going to try and convince my
    employer to put a sample of this code up on a public page somewhere.

    --
    You received this message because you are subscribed to the Google Groups "webdriver" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/webdriver/-/79NHXCwG70MJ.
    To post to this group, send email to webdriver@googlegroups.com.
    To unsubscribe from this group, send email to webdriver+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/webdriver?hl=en.
  • Darrell at Nov 1, 2012 at 2:42 pm
    It sounds like the problem is whatever happens when you click the element
    which closes the popup window. I'm guessing clicking the element transfers
    the value on the popup back to default content. If could be the way the
    developer is saving and transferring the information from the popup back to
    the default content is the problem.

    If it is a timing issue, you could try putting in some Thread.sleep(5000)
    in various places. If this solves the problem you know it is a timing
    issue. You'll have to remove the various sleep statements until you figure
    out which one solved the problem. Once you know where you need to wait,
    change the sleep statement to wait for the appropriate event.

    If it is something which the developer is doing which is illegal but works
    for humans, see if you can figure that out (use tools to examine the page
    for compliance, e.g. Tidy to examine HTML). Maybe doing the right thing
    will help WebDriver to work.

    Could be you found an edge case where WebDriver fails. You'll have to find
    a workaround which will continue to work even if they fix the defect.

    Finally, you could be dealing with more than one issue and might be looking
    for multiple solutions (lot harder to deal with).

    Darrell
    On Wednesday, 31 October 2012 05:48:21 UTC-7, Rino van Dam wrote:

    Darrel, Alexei and others: thank you for your replies.

    First, I need to adjust my problem description. Since I wrote the first
    post, I have realized that webdriver actually hangs immediately after
    executing the code that closes the popup. It never gets to the line that
    switches back to the default content. So:

    - I use switchTo().frame("LookupWindow") to switch to the popup.
    - I then successfully enter some text and look up a value
    - Once the value is found, I click on on it (still on the popup)
    - The popup now closes (because I clicked on the value in the popup)

    This all works fine, but webdriver now hangs. It never gets to
    execute switchTo().defaultContent()

    Also: this is on Firefox 15.0.1, Selenium (java) 2.25.

    I have successfully used similar code (switchTo()... etc) in the past, but
    there the popup didn't close itself. I am going to try and convince my
    employer to put a sample of this code up on a public page somewhere.
    --
    You received this message because you are subscribed to the Google Groups "webdriver" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/webdriver/-/XdBenIvukBAJ.
    To post to this group, send email to webdriver@googlegroups.com.
    To unsubscribe from this group, send email to webdriver+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/webdriver?hl=en.
  • Phil at Nov 1, 2012 at 3:08 pm
    My problem was fixed by upgrading to Firefox 14, previously used 13.
    Thanks all

    --
    You received this message because you are subscribed to the Google Groups "webdriver" group.
    To post to this group, send email to webdriver@googlegroups.com.
    To unsubscribe from this group, send email to webdriver+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/webdriver?hl=en.
  • Rino van Dam at Nov 2, 2012 at 1:38 pm
    Have a demo site up where problem may be recreated. Updated issue 2703 on
    code.google.com with the necessary info.

    --
    You received this message because you are subscribed to the Google Groups "webdriver" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/webdriver/-/dEwxZ0l82WMJ.
    To post to this group, send email to webdriver@googlegroups.com.
    To unsubscribe from this group, send email to webdriver+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/webdriver?hl=en.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupwebdriver @
categorieswatir
postedOct 30, '12 at 7:48a
activeNov 2, '12 at 1:38p
posts9
users5
websitewatir.com

People

Translate

site design / logo © 2021 Grokbase