FAQ
Hi

I am having trouble in identifying an element in other frame on the same
page although I have successfully switched to that particular frame.

testing site: http://winningbids.com/

Using following code to switch that frame

driver.switchTo().frame(driver.findElement(By.xpath("//div[4]/iframe")));

but not able to identify

driver.findElement(By.xpath("//img[@class='by_zopim']")).click();

Plz Helppp!

--
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/-/G3xhpBoWc3EJ.
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

  • Susanth.nair at Sep 19, 2012 at 10:25 am
    use like this


    driver.switchTo().frame(0);
    driver.switchTo().frame(1);

    or (IE wont work with index as shown above)

    driver.switchTo().frame("your app Frame0 name");
    driver.switchTo().frame("your app Frame1 name");

    --
    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.
  • Pratika at Sep 19, 2012 at 1:07 pm
    Thanks for reply

    I already tried this but its not working. I am still not able to identify
    any element inside this frame. But if i am using


    driver.switchTo().frame(driver.findElement(By.xpath("//div[4]/iframe")));
    driver.findElement(By.xpath("//div")).click();

    application opens that particular form
    but do not click any element of this frame

    Here is the Sourcecode of frame

    <iframe frameborder="0" __jx__id="___$_13__iframe" src="javascript:false"
    style="background-color: transparent; vertical-align: text-bottom;
    overflow: hidden; position: relative; width: 100%; height: 100%; margin:
    0px; z-index: 999999;">
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html lang="en" style="overflow-y: hidden;" dir="ltr">
    <head>
    <body class="" style="position: relative; overflow-y: hidden;">
    <div __jx__id="___$_15" style="position: absolute; overflow: hidden; left:
    0px; right: 0px; top: 0px; bottom: 0px; background: none repeat scroll 0%
    0% transparent; padding: 0px; cursor: pointer; -moz-user-select: none;">
    <div class=" jx_controls_SkinAbsolute" __jx__id="___$_17 ___$_16
    ___$_13__skin" style="position: absolute; overflow: hidden; left: 0px;
    right: 0px; top: 0px; bottom: 0px; z-index: -1; display: block;">
    <div __jx__id="___$_13__content" style="position: absolute; overflow: auto;
    top: 6px; font-size: 12px; line-height: 20px; right: 6px; bottom: 0px;
    left: 6px;">
    <img __jx__id="___$_1__liveHelpButton__statusImage" style="display: inline;
    margin: 2px 5px 0px; float: left; width: 16px; height: 16px;"
    src="http://cdn.zopim.com/assets/branding/zopim.com/chatman/offline_new.png">
    <span class="button_message light"
    __jx__id="___$_1__liveHelpButton__buttonMessage" style="color: rgb(255,
    255, 255);">
    <span class="agentStatus"
    __jx__id="___$_1__liveHelpButton__agentStatus">Offline</span>
    -
    <span class="message" __jx__id="___$_1__liveHelpButton__message">Leave a
    message</span>
    </span>

    On Wednesday, September 19, 2012 3:55:47 PM UTC+5:30, susanth b wrote:

    use like this


    driver.switchTo().frame(0);
    driver.switchTo().frame(1);

    or (IE wont work with index as shown above)

    driver.switchTo().frame("your app Frame0 name");
    driver.switchTo().frame("your app Frame1 name");

    --
    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/-/Y_4Ni6eb2kQJ.
    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.
  • Ben Thomas at Sep 20, 2012 at 11:21 am
    the iframe does not have a name, if you can give it a name then the example
    the other person gave should work.
    On Wednesday, September 19, 2012 5:18:16 AM UTC-5, pratika wrote:

    Hi

    I am having trouble in identifying an element in other frame on the same
    page although I have successfully switched to that particular frame.

    testing site: http://winningbids.com/

    Using following code to switch that frame

    driver.switchTo().frame(driver.findElement(By.xpath("//div[4]/iframe")));

    but not able to identify

    driver.findElement(By.xpath("//img[@class='by_zopim']")).click();

    Plz Helppp!
    --
    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/-/Hi51wGpgpekJ.
    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.
  • Pratika at Sep 21, 2012 at 4:13 am
    Hi Ben
    How can I give a name to iframe in my script ...... I am not familiar with
    this way.....can you explain
    On Thursday, September 20, 2012 2:07:07 AM UTC+5:30, Ben Thomas wrote:

    the iframe does not have a name, if you can give it a name then the
    example the other person gave should work.
    On Wednesday, September 19, 2012 5:18:16 AM UTC-5, pratika wrote:

    Hi

    I am having trouble in identifying an element in other frame on the same
    page although I have successfully switched to that particular frame.

    testing site: http://winningbids.com/

    Using following code to switch that frame


    driver.switchTo().frame(driver.findElement(By.xpath("//div[4]/iframe")));

    but not able to identify

    driver.findElement(By.xpath("//img[@class='by_zopim']")).click();

    Plz Helppp!
    --
    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/-/KPq95-W4sLIJ.
    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 Sep 20, 2012 at 7:38 pm
    I looked at the testing site. You don't indicate what the error is but I'm
    guessing you are doing:

    - get the page
    - switch to the frame
    - click the image

    The image is not visible. Switching to a frame will not throw an exception
    but clicking an invisible image will. A real user would do:

    - get the page
    - switch to the frame
    - click the "offline - leave a message"
    - wait for form to appear
    - click the image

    Darrell

    On Wednesday, 19 September 2012 06:18:16 UTC-4, pratika wrote:

    Hi

    I am having trouble in identifying an element in other frame on the same
    page although I have successfully switched to that particular frame.

    testing site: http://winningbids.com/

    Using following code to switch that frame

    driver.switchTo().frame(driver.findElement(By.xpath("//div[4]/iframe")));

    but not able to identify

    driver.findElement(By.xpath("//img[@class='by_zopim']")).click();

    Plz Helppp!
    --
    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/-/-sJyDfkISGwJ.
    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.
  • Pratika at Sep 21, 2012 at 4:08 am
    Thanks for reply darrell

    I have used following code. It works till form appears but again throws
    same exception

    "Unable to locate element" (//img[@class='by_zopim)


    driver.switchTo().frame(driver.findElement(By.xpath("//div[4]/iframe")));
    driver.findElement(By.xpath("//div")).click();
    Thread.sleep(2000);
    driver.findElement(By.xpath("//img[@class='by_zopim']")).click();
    On Friday, September 21, 2012 1:08:16 AM UTC+5:30, darrell wrote:

    I looked at the testing site. You don't indicate what the error is but I'm
    guessing you are doing:

    - get the page
    - switch to the frame
    - click the image

    The image is not visible. Switching to a frame will not throw an exception
    but clicking an invisible image will. A real user would do:

    - get the page
    - switch to the frame
    - click the "offline - leave a message"
    - wait for form to appear
    - click the image

    Darrell

    On Wednesday, 19 September 2012 06:18:16 UTC-4, pratika wrote:

    Hi

    I am having trouble in identifying an element in other frame on the same
    page although I have successfully switched to that particular frame.

    testing site: http://winningbids.com/

    Using following code to switch that frame


    driver.switchTo().frame(driver.findElement(By.xpath("//div[4]/iframe")));

    but not able to identify

    driver.findElement(By.xpath("//img[@class='by_zopim']")).click();

    Plz Helppp!
    --
    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/-/ADu7QIAb2LwJ.
    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 Sep 21, 2012 at 2:18 pm
    Your code is using a hard coded number (i.e. 4) but the element has an id
    attribute. You are chaining multiple calls on one line without confirming
    they worked. I would do the findElement call and confirm, with an IDE and
    watch window, that the element was being found. I might also try looking at
    getPageSource to see which frame driver REALLY thinks it is looking at.
    Once I am sure I found the correct element on the main window I would
    switch to the new frame. Once I confirm I have switched to the correct
    frame THEN I would make sure I am finding the right element. Only once I am
    sure I found the right element would I click it.

    Bottom line, if you are doing 2, 3 or 4 actions without checking the were
    successful, how can you be sure the final action is the failure point?
    Computers are dumb. Just because the computer tells me it is "Unable to
    locate element" doesn't mean I believe that is the failure point.

    Darrell

    On Friday, 21 September 2012 00:08:41 UTC-4, pratika wrote:

    Thanks for reply darrell

    I have used following code. It works till form appears but again throws
    same exception

    "Unable to locate element" (//img[@class='by_zopim)


    driver.switchTo().frame(driver.findElement(By.xpath("//div[4]/iframe")));
    driver.findElement(By.xpath("//div")).click();
    Thread.sleep(2000);
    driver.findElement(By.xpath("//img[@class='by_zopim']")).click();
    On Friday, September 21, 2012 1:08:16 AM UTC+5:30, darrell wrote:

    I looked at the testing site. You don't indicate what the error is but
    I'm guessing you are doing:

    - get the page
    - switch to the frame
    - click the image

    The image is not visible. Switching to a frame will not throw an
    exception but clicking an invisible image will. A real user would do:

    - get the page
    - switch to the frame
    - click the "offline - leave a message"
    - wait for form to appear
    - click the image

    Darrell

    On Wednesday, 19 September 2012 06:18:16 UTC-4, pratika wrote:

    Hi

    I am having trouble in identifying an element in other frame on the same
    page although I have successfully switched to that particular frame.

    testing site: http://winningbids.com/

    Using following code to switch that frame


    driver.switchTo().frame(driver.findElement(By.xpath("//div[4]/iframe")));

    but not able to identify

    driver.findElement(By.xpath("//img[@class='by_zopim']")).click();

    Plz Helppp!
    --
    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/-/ueSyXSyvKZUJ.
    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
postedSep 19, '12 at 10:18a
activeSep 21, '12 at 2:18p
posts8
users4
websitewatir.com

People

Translate

site design / logo © 2021 Grokbase