FAQ
I haven't found anything about this topic yet, nor in the issue
tracker, but came across the fact that one of the acceptance tests
dealing with window and frame switching is skipped for Safari:

http://selenium.googlecode.com/svn/trunk/dotnet/test/WebDriver.Common.Tests/WindowSwitchingTest.cs

Would like to confirm, does SafariDriver support switchin frames/
iframes? I can understand lack of support for window switching since
it can't handle alerts and can't open new window (via javascript). But
frames/iframes too?

Calling something like
driver.switchTo().frame(driver.findElements(By.tagName("iframe")).get(0));
can return timeout exception with message Timed out awaiting response
to command "switchToFrame" after 30002 ms

Calling driver.switchTo().frame(0); can return WebDriverException with
message 'undefined' is not an object (evaluating
'a.contentWindow.document')

I tried against different valid frames numbers (1, etc.) and it either
returned same errors or that it couldn't find element of next command
since it wasn't on the right frame.

I haven't seen the iframe switching issue in FF or IE so far.

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

Search Discussions

  • Darrell at Aug 16, 2012 at 1:29 pm
    SafariDriver does not support frames. This was a big problem for me.
    Approximately 45% of my customers are Safari/Mac users and my
    application uses iframes quite heavily. :(
    On Aug 15, 9:50 pm, David wrote:
    I haven't found anything about this topic yet, nor in the issue
    tracker, but came across the fact that one of the acceptance tests
    dealing with window and frame switching is skipped for Safari:

    http://selenium.googlecode.com/svn/trunk/dotnet/test/WebDriver.Common...

    Would like to confirm, does SafariDriver support switchin frames/
    iframes? I can understand lack of support for window switching since
    it can't handle alerts and can't open new window (via javascript). But
    frames/iframes too?

    Calling something like
    driver.switchTo().frame(driver.findElements(By.tagName("iframe")).get(0));
    can return timeout exception with message Timed out awaiting response
    to command "switchToFrame" after 30002 ms

    Calling driver.switchTo().frame(0); can return WebDriverException with
    message 'undefined' is not an object (evaluating
    'a.contentWindow.document')

    I tried against different valid frames numbers (1, etc.) and it either
    returned same errors or that it couldn't find element of next command
    since it wasn't on the right frame.

    I haven't seen the iframe switching issue in FF or IE so far.
    --
    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.
  • David at Aug 17, 2012 at 10:46 pm
    Thanks Darrell.

    Is there a logged issue for that lack of support? Or it assume bundled
    with the window open / alert issues?

    Good to have a reference tracked in the issues list.
    On Aug 16, 6:29 am, darrell wrote:
    SafariDriver does not support frames. This was a big problem for me.
    Approximately 45% of my customers are Safari/Mac users and my
    application uses iframes quite heavily. :(

    On Aug 15, 9:50 pm, David wrote:






    I haven't found anything about this topic yet, nor in the issue
    tracker, but came across the fact that one of the acceptance tests
    dealing with window and frame switching is skipped for Safari:
    http://selenium.googlecode.com/svn/trunk/dotnet/test/WebDriver.Common...
    Would like to confirm, does SafariDriver support switchin frames/
    iframes? I can understand lack of support for window switching since
    it can't handle alerts and can't open new window (via javascript). But
    frames/iframes too?
    Calling something like
    driver.switchTo().frame(driver.findElements(By.tagName("iframe")).get(0));
    can return timeout exception with message Timed out awaiting response
    to command "switchToFrame" after 30002 ms
    Calling driver.switchTo().frame(0); can return WebDriverException with
    message 'undefined' is not an object (evaluating
    'a.contentWindow.document')
    I tried against different valid frames numbers (1, etc.) and it either
    returned same errors or that it couldn't find element of next command
    since it wasn't on the right frame.
    I haven't seen the iframe switching issue in FF or IE so far.
    --
    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.
  • Sumit Saxena at Aug 18, 2012 at 4:43 am
    Hi David you can use robot class for safari too
    On Sat, Aug 18, 2012 at 4:16 AM, David wrote:

    Thanks Darrell.

    Is there a logged issue for that lack of support? Or it assume bundled
    with the window open / alert issues?

    Good to have a reference tracked in the issues list.
    On Aug 16, 6:29 am, darrell wrote:
    SafariDriver does not support frames. This was a big problem for me.
    Approximately 45% of my customers are Safari/Mac users and my
    application uses iframes quite heavily. :(

    On Aug 15, 9:50 pm, David wrote:






    I haven't found anything about this topic yet, nor in the issue
    tracker, but came across the fact that one of the acceptance tests
    dealing with window and frame switching is skipped for Safari:
    http://selenium.googlecode.com/svn/trunk/dotnet/test/WebDriver.Common.
    ..
    Would like to confirm, does SafariDriver support switchin frames/
    iframes? I can understand lack of support for window switching since
    it can't handle alerts and can't open new window (via javascript). But
    frames/iframes too?
    Calling something like
    driver.switchTo().frame(driver.findElements(By.tagName("iframe")).get(0));
    can return timeout exception with message Timed out awaiting response
    to command "switchToFrame" after 30002 ms
    Calling driver.switchTo().frame(0); can return WebDriverException with
    message 'undefined' is not an object (evaluating
    'a.contentWindow.document')
    I tried against different valid frames numbers (1, etc.) and it either
    returned same errors or that it couldn't find element of next command
    since it wasn't on the right frame.
    I haven't seen the iframe switching issue in FF or IE so far.
    --
    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.
    --
    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 Aug 24, 2012 at 12:21 pm
    Hi David,

    I don't know if there is a logged issue. The moment it came out I got it
    and the release notes for it. It was stated in the release notes that
    frames were not supported. I had plenty of work in other areas. So I put
    Safari on the back burner until I could put a dent in the other issues.

    Darrell
    On Friday, 17 August 2012 18:46:35 UTC-4, David wrote:

    Thanks Darrell.

    Is there a logged issue for that lack of support? Or it assume bundled
    with the window open / alert issues?

    Good to have a reference tracked in the issues list.
    On Aug 16, 6:29 am, darrell wrote:
    SafariDriver does not support frames. This was a big problem for me.
    Approximately 45% of my customers are Safari/Mac users and my
    application uses iframes quite heavily. :(

    On Aug 15, 9:50 pm, David wrote:






    I haven't found anything about this topic yet, nor in the issue
    tracker, but came across the fact that one of the acceptance tests
    dealing with window and frame switching is skipped for Safari:
    http://selenium.googlecode.com/svn/trunk/dotnet/test/WebDriver.Common...
    Would like to confirm, does SafariDriver support switchin frames/
    iframes? I can understand lack of support for window switching since
    it can't handle alerts and can't open new window (via javascript). But
    frames/iframes too?
    Calling something like
    driver.switchTo().frame(driver.findElements(By.tagName("iframe")).get(0));
    can return timeout exception with message Timed out awaiting response
    to command "switchToFrame" after 30002 ms
    Calling driver.switchTo().frame(0); can return WebDriverException with
    message 'undefined' is not an object (evaluating
    'a.contentWindow.document')
    I tried against different valid frames numbers (1, etc.) and it either
    returned same errors or that it couldn't find element of next command
    since it wasn't on the right frame.
    I haven't seen the iframe switching issue in FF or IE so far.
    --
    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/-/bRGyRlwIHbMJ.
    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.
  • Krishnan Mahadevan at Aug 24, 2012 at 1:51 pm
    David/Darrell,

    From the total issues raised for SafariDriver :
    http://code.google.com/p/selenium/issues/list?can=1&q=browser%3DSafari+component%3DWebDriver+status%3ANew%2CAccepted%2CWorkingAsIntended%2CWontFix%2CNotFeasible%2CFixed&colspec=ID+Stars+Type+Status+Priority+Owner+Summary+Browser+Component&cells=tiles


    I found this : http://code.google.com/p/selenium/issues/detail?id=3945

    3945 doesn't talk about switching to iframes, but it does state this : "If
    an iframe is removed from the DOM after the
    SafariDriver<http://code.google.com/p/selenium/wiki/SafariDriver?can=1&q=browser%3DSafari%20component%3DWebDriver%20status%3ANew%2CAccepted%2CWorkingAsIntended%2CWontFix%2CNotFeasible%2CFixed&colspec=ID%20Stars%20Type%20Status%20Priority%20Owner%20Summary%20Browser%20Component>has
    focused on it, the driver will hang."

    which makes me believe that perhaps iframes support is there in SafariDriver

    Hope that helps !

    Thanks & Regards
    Krishnan Mahadevan

    "All the desirable things in life are either illegal, expensive, fattening
    or in love with someone else!"


    On Fri, Aug 24, 2012 at 5:51 PM, darrell wrote:

    Hi David,

    I don't know if there is a logged issue. The moment it came out I got it
    and the release notes for it. It was stated in the release notes that
    frames were not supported. I had plenty of work in other areas. So I put
    Safari on the back burner until I could put a dent in the other issues.

    Darrell
    On Friday, 17 August 2012 18:46:35 UTC-4, David wrote:

    Thanks Darrell.

    Is there a logged issue for that lack of support? Or it assume bundled
    with the window open / alert issues?

    Good to have a reference tracked in the issues list.
    On Aug 16, 6:29 am, darrell wrote:
    SafariDriver does not support frames. This was a big problem for me.
    Approximately 45% of my customers are Safari/Mac users and my
    application uses iframes quite heavily. :(

    On Aug 15, 9:50 pm, David wrote:






    I haven't found anything about this topic yet, nor in the issue
    tracker, but came across the fact that one of the acceptance tests
    dealing with window and frame switching is skipped for Safari:
    http://selenium.googlecode.**com/svn/trunk/dotnet/test/**
    WebDriver.Common.<http://selenium.googlecode.com/svn/trunk/dotnet/test/WebDriver.Common.>..
    Would like to confirm, does SafariDriver support switchin frames/
    iframes? I can understand lack of support for window switching since
    it can't handle alerts and can't open new window (via javascript).
    But
    frames/iframes too?
    Calling something like
    driver.switchTo().frame(**driver.findElements(By.**tagName("iframe")).get(0));
    can return timeout exception with message Timed out awaiting response
    to command "switchToFrame" after 30002 ms
    Calling driver.switchTo().frame(0); can return WebDriverException
    with
    message 'undefined' is not an object (evaluating
    'a.contentWindow.document')
    I tried against different valid frames numbers (1, etc.) and it
    either
    returned same errors or that it couldn't find element of next command
    since it wasn't on the right frame.
    I haven't seen the iframe switching issue in FF or IE so far.
    --
    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/-/bRGyRlwIHbMJ.
    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.
    --
    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.
  • Pavithra at Aug 27, 2012 at 11:51 am
    Switch to frame in safari driver works fine for me !!

    --Pavithra

    --
    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/-/PW3RP23wl9AJ.
    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.
  • Siva at Apr 16, 2013 at 11:19 am
    Hi Pavithra,

    Can you tell me how it worked for you? Can you give us the steps to switch
    to frame in Safari -?

    We are trying the below:
    driver().switchTo().defaultContent();
    driver().switchTo().frame("<iframe_name>");
    driver().switchTo().activeElement();

    But we got the error same as David mentioned.

    Wrapped org.openqa.selenium.WebDriverException: 'undefined' is not an object (evaluating 'a.contentWindow.document')
    (WARNING: The server did not provide any stacktrace information)


    So whether Safari Driver really supports iframe? If so, just provide the
    steps.
    On Monday, August 27, 2012 7:51:53 AM UTC-4, Pavithra wrote:

    Switch to frame in safari driver works fine for me !!

    --Pavithra
    --
    You received this message because you are subscribed to the Google Groups "webdriver" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to webdriver+unsubscribe@googlegroups.com.
    To post to this group, send email to webdriver@googlegroups.com.
    Visit this group at http://groups.google.com/group/webdriver?hl=en.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Sumit Saxena at Apr 17, 2013 at 9:31 am
    Here we need to use robot class

    On Tue, Apr 16, 2013 at 4:19 AM, Siva wrote:

    Hi Pavithra,

    Can you tell me how it worked for you? Can you give us the steps to switch
    to frame in Safari -?

    We are trying the below:
    driver().switchTo().defaultContent();
    driver().switchTo().frame("<iframe_name>");
    driver().switchTo().activeElement();

    But we got the error same as David mentioned.

    Wrapped org.openqa.selenium.WebDriverException: 'undefined' is not an object (evaluating 'a.contentWindow.document')
    (WARNING: The server did not provide any stacktrace information)


    So whether Safari Driver really supports iframe? If so, just provide the
    steps.
    On Monday, August 27, 2012 7:51:53 AM UTC-4, Pavithra wrote:

    Switch to frame in safari driver works fine for me !!

    --Pavithra

    --
    You received this message because you are subscribed to the Google Groups
    "webdriver" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to webdriver+unsubscribe@googlegroups.com.
    To post to this group, send email to webdriver@googlegroups.com.
    Visit this group at http://groups.google.com/group/webdriver?hl=en.
    For more options, visit https://groups.google.com/groups/opt_out.

    --
    You received this message because you are subscribed to the Google Groups "webdriver" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to webdriver+unsubscribe@googlegroups.com.
    To post to this group, send email to webdriver@googlegroups.com.
    Visit this group at http://groups.google.com/group/webdriver?hl=en.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Test SCF at May 22, 2013 at 6:26 am
    Thanks all for your suggestions.

    The below change in switching to iframe in Safari worked perfectly for me.

    driver.switchTo().frame(*driver**.findElement(By.id*("frame_name")));

    Had to use driver findElement By Id for frame while switching - that is the
    reason it was throwing undefined.

    Once it was switched - I was able to type into the text box as normal by
    selenium functions itself.

    As Sumit suggested, we can use *java.awt.Robot* class also to type inside
    the iframe.



    On Wed, Apr 17, 2013 at 3:01 PM, Sumit Saxena wrote:

    Here we need to use robot class

    On Tue, Apr 16, 2013 at 4:19 AM, Siva wrote:

    Hi Pavithra,

    Can you tell me how it worked for you? Can you give us the steps to
    switch to frame in Safari -?

    We are trying the below:
    driver().switchTo().defaultContent();
    driver().switchTo().frame("<iframe_name>");
    driver().switchTo().activeElement();

    But we got the error same as David mentioned.

    Wrapped org.openqa.selenium.WebDriverException: 'undefined' is not an object (evaluating 'a.contentWindow.document')
    (WARNING: The server did not provide any stacktrace information)


    So whether Safari Driver really supports iframe? If so, just provide the
    steps.
    On Monday, August 27, 2012 7:51:53 AM UTC-4, Pavithra wrote:

    Switch to frame in safari driver works fine for me !!

    --Pavithra

    --
    You received this message because you are subscribed to the Google Groups
    "webdriver" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to webdriver+unsubscribe@googlegroups.com.
    To post to this group, send email to webdriver@googlegroups.com.
    Visit this group at http://groups.google.com/group/webdriver?hl=en.
    For more options, visit https://groups.google.com/groups/opt_out.

    --
    You received this message because you are subscribed to the Google Groups
    "webdriver" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to webdriver+unsubscribe@googlegroups.com.
    To post to this group, send email to webdriver@googlegroups.com.
    Visit this group at http://groups.google.com/group/webdriver?hl=en.
    For more options, visit https://groups.google.com/groups/opt_out.

    --
    You received this message because you are subscribed to the Google Groups "webdriver" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to webdriver+unsubscribe@googlegroups.com.
    To post to this group, send email to webdriver@googlegroups.com.
    Visit this group at http://groups.google.com/group/webdriver?hl=en.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Xu Yang at Jan 20, 2015 at 11:32 am
    Hi Siva,

    I got such exception 'org.openqa.selenium.NoSuchElementException: could not
    find element' when using
    dr.switchTo().frame(*driver**.findElement(By.id*(IframeID)));
      Do you have any suggestion on it?


    在 2013年5月22日星期三 UTC+8下午2:26:08,Siva写道:
    Thanks all for your suggestions.

    The below change in switching to iframe in Safari worked perfectly for me.

    driver.switchTo().frame(*driver**.findElement(By.id*("frame_name")));

    Had to use driver findElement By Id for frame while switching - that is
    the reason it was throwing undefined.

    Once it was switched - I was able to type into the text box as normal by
    selenium functions itself.

    As Sumit suggested, we can use *java.awt.Robot* class also to type inside
    the iframe.




    On Wed, Apr 17, 2013 at 3:01 PM, Sumit Saxena <sumit...@gmail.com
    <javascript:>> wrote:
    Here we need to use robot class


    On Tue, Apr 16, 2013 at 4:19 AM, Siva <test...@gmail.com <javascript:>>
    wrote:
    Hi Pavithra,

    Can you tell me how it worked for you? Can you give us the steps to
    switch to frame in Safari -?

    We are trying the below:
    driver().switchTo().defaultContent();
    driver().switchTo().frame("<iframe_name>");
    driver().switchTo().activeElement();

    But we got the error same as David mentioned.

    Wrapped org.openqa.selenium.WebDriverException: 'undefined' is not an object (evaluating 'a.contentWindow.document')
    (WARNING: The server did not provide any stacktrace information)


    So whether Safari Driver really supports iframe? If so, just provide the
    steps.
    On Monday, August 27, 2012 7:51:53 AM UTC-4, Pavithra wrote:

    Switch to frame in safari driver works fine for me !!

    --Pavithra

    --
    You received this message because you are subscribed to the Google
    Groups "webdriver" group.
    To unsubscribe from this group and stop receiving emails from it, send
    an email to webdriver+...@googlegroups.com <javascript:>.
    To post to this group, send email to webd...@googlegroups.com
    <javascript:>.
    Visit this group at http://groups.google.com/group/webdriver?hl=en.
    For more options, visit https://groups.google.com/groups/opt_out.

    --
    You received this message because you are subscribed to the Google Groups
    "webdriver" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to webdriver+...@googlegroups.com <javascript:>.
    To post to this group, send email to webd...@googlegroups.com
    <javascript:>.
    Visit this group at http://groups.google.com/group/webdriver?hl=en.
    For more options, visit https://groups.google.com/groups/opt_out.

    --
    You received this message because you are subscribed to the Google Groups "webdriver" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to webdriver+unsubscribe@googlegroups.com.
    To post to this group, send email to webdriver@googlegroups.com.
    Visit this group at http://groups.google.com/group/webdriver.
    For more options, visit https://groups.google.com/d/optout.
  • Selenium Framework at Jan 20, 2015 at 6:32 pm
    Please see the below code. It executes fine and the driver is able to
    switch to the iframe and access an element inside the frame [The sleep was
    needed for synchronization as sometimes SafariDriver is taking time to
    connect on my machine]. Maybe I am just lucky to have it working [As David
    mentioned it might be spotty]


        1. Assuming you have all the jars, run the below class
        2. Selenium 2.44.0.jar , Safari Extension 2.38 [Safari - Preferences -
        Extensions]


    import org.openqa.selenium.By;
    import org.openqa.selenium.WebDriver;
    import org.openqa.selenium.WebElement;
    import org.openqa.selenium.safari.SafariDriver;


    public class SimpleTest{

         public static void main(String args[]) throws Exception
         {
             WebDriver driver = new SafariDriver();
             driver.navigate().to("http://yourhtmlsource.com/frames/inlineframes.html");
             Thread.sleep(5000);
             WebElement frame = driver.findElement(By.name("bomb"));
             System.out.println(frame.getAttribute("outerHTML"));
             driver.switchTo().frame(driver.findElement(By.name("bomb")));
                     WebElement frame_body = driver.findElement(By.tagName("body"));
             System.out.println(frame_body.getAttribute("outerHTML"));
             driver.quit();
         }
    }


    cheers

    http://www.seleniumframework.com


    On Monday, January 19, 2015 at 2:23:39 AM UTC-5, Xu Yang wrote:

    Hi Siva,

    I got such exception 'org.openqa.selenium.NoSuchElementException: could
    not find element' when using
    dr.switchTo().frame(*driver**.findElement(By.id*(IframeID)));
    Do you have any suggestion on it?


    在 2013年5月22日星期三 UTC+8下午2:26:08,Siva写道:
    Thanks all for your suggestions.

    The below change in switching to iframe in Safari worked perfectly for me.

    driver.switchTo().frame(*driver**.findElement(By.id*("frame_name")));

    Had to use driver findElement By Id for frame while switching - that is
    the reason it was throwing undefined.

    Once it was switched - I was able to type into the text box as normal by
    selenium functions itself.

    As Sumit suggested, we can use *java.awt.Robot* class also to type
    inside the iframe.



    On Wed, Apr 17, 2013 at 3:01 PM, Sumit Saxena wrote:

    Here we need to use robot class

    On Tue, Apr 16, 2013 at 4:19 AM, Siva wrote:

    Hi Pavithra,

    Can you tell me how it worked for you? Can you give us the steps to
    switch to frame in Safari -?

    We are trying the below:
    driver().switchTo().defaultContent();
    driver().switchTo().frame("<iframe_name>");
    driver().switchTo().activeElement();

    But we got the error same as David mentioned.

    Wrapped org.openqa.selenium.WebDriverException: 'undefined' is not an object (evaluating 'a.contentWindow.document')
    (WARNING: The server did not provide any stacktrace information)


    So whether Safari Driver really supports iframe? If so, just provide
    the steps.
    On Monday, August 27, 2012 7:51:53 AM UTC-4, Pavithra wrote:

    Switch to frame in safari driver works fine for me !!

    --Pavithra

    --
    You received this message because you are subscribed to the Google
    Groups "webdriver" group.
    To unsubscribe from this group and stop receiving emails from it, send
    an email to webdriver+...@googlegroups.com.
    To post to this group, send email to webd...@googlegroups.com.
    Visit this group at http://groups.google.com/group/webdriver?hl=en.
    For more options, visit https://groups.google.com/groups/opt_out.

    --
    You received this message because you are subscribed to the Google
    Groups "webdriver" group.
    To unsubscribe from this group and stop receiving emails from it, send
    an email to webdriver+...@googlegroups.com.
    To post to this group, send email to webd...@googlegroups.com.
    Visit this group at http://groups.google.com/group/webdriver?hl=en.
    For more options, visit https://groups.google.com/groups/opt_out.

    --
    You received this message because you are subscribed to the Google Groups "webdriver" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to webdriver+unsubscribe@googlegroups.com.
    To post to this group, send email to webdriver@googlegroups.com.
    Visit this group at http://groups.google.com/group/webdriver.
    For more options, visit https://groups.google.com/d/optout.
  • Xu Yang at Jan 21, 2015 at 9:56 am
    Thanks a lot for your help, I have successfully switched to the Iframe in
    Safari with the way you mentioned.

    在 2015年1月21日星期三 UTC+8上午2:32:24,Selenium Framework写道:
    Please see the below code. It executes fine and the driver is able to
    switch to the iframe and access an element inside the frame [The sleep was
    needed for synchronization as sometimes SafariDriver is taking time to
    connect on my machine]. Maybe I am just lucky to have it working [As David
    mentioned it might be spotty]


    1. Assuming you have all the jars, run the below class
    2. Selenium 2.44.0.jar , Safari Extension 2.38 [Safari - Preferences -
    Extensions]


    import org.openqa.selenium.By;
    import org.openqa.selenium.WebDriver;
    import org.openqa.selenium.WebElement;
    import org.openqa.selenium.safari.SafariDriver;


    public class SimpleTest{

    public static void main(String args[]) throws Exception
    {
    WebDriver driver = new SafariDriver();
    driver.navigate().to("http://yourhtmlsource.com/frames/inlineframes.html");
    Thread.sleep(5000);
    WebElement frame = driver.findElement(By.name("bomb"));
    System.out.println(frame.getAttribute("outerHTML"));
    driver.switchTo().frame(driver.findElement(By.name("bomb")));
    WebElement frame_body = driver.findElement(By.tagName("body"));
    System.out.println(frame_body.getAttribute("outerHTML"));
    driver.quit();
    }
    }


    cheers

    http://www.seleniumframework.com


    On Monday, January 19, 2015 at 2:23:39 AM UTC-5, Xu Yang wrote:

    Hi Siva,

    I got such exception 'org.openqa.selenium.NoSuchElementException: could
    not find element' when using
    dr.switchTo().frame(*driver**.findElement(By.id*(IframeID)));
    Do you have any suggestion on it?


    在 2013年5月22日星期三 UTC+8下午2:26:08,Siva写道:
    Thanks all for your suggestions.

    The below change in switching to iframe in Safari worked perfectly for
    me.

    driver.switchTo().frame(*driver**.findElement(By.id*("frame_name")));

    Had to use driver findElement By Id for frame while switching - that is
    the reason it was throwing undefined.

    Once it was switched - I was able to type into the text box as normal by
    selenium functions itself.

    As Sumit suggested, we can use *java.awt.Robot* class also to type
    inside the iframe.




    On Wed, Apr 17, 2013 at 3:01 PM, Sumit Saxena <sumit...@gmail.com>
    wrote:
    Here we need to use robot class

    On Tue, Apr 16, 2013 at 4:19 AM, Siva wrote:

    Hi Pavithra,

    Can you tell me how it worked for you? Can you give us the steps to
    switch to frame in Safari -?

    We are trying the below:
    driver().switchTo().defaultContent();
    driver().switchTo().frame("<iframe_name>");
    driver().switchTo().activeElement();

    But we got the error same as David mentioned.

    Wrapped org.openqa.selenium.WebDriverException: 'undefined' is not an object (evaluating 'a.contentWindow.document')
    (WARNING: The server did not provide any stacktrace information)


    So whether Safari Driver really supports iframe? If so, just provide
    the steps.
    On Monday, August 27, 2012 7:51:53 AM UTC-4, Pavithra wrote:

    Switch to frame in safari driver works fine for me !!

    --Pavithra

    --
    You received this message because you are subscribed to the Google
    Groups "webdriver" group.
    To unsubscribe from this group and stop receiving emails from it, send
    an email to webdriver+...@googlegroups.com.
    To post to this group, send email to webd...@googlegroups.com.
    Visit this group at http://groups.google.com/group/webdriver?hl=en.
    For more options, visit https://groups.google.com/groups/opt_out.

    --
    You received this message because you are subscribed to the Google
    Groups "webdriver" group.
    To unsubscribe from this group and stop receiving emails from it, send
    an email to webdriver+...@googlegroups.com.
    To post to this group, send email to webd...@googlegroups.com.
    Visit this group at http://groups.google.com/group/webdriver?hl=en.
    For more options, visit https://groups.google.com/groups/opt_out.

    --
    You received this message because you are subscribed to the Google Groups "webdriver" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to webdriver+unsubscribe@googlegroups.com.
    To post to this group, send email to webdriver@googlegroups.com.
    Visit this group at http://groups.google.com/group/webdriver.
    For more options, visit https://groups.google.com/d/optout.
  • David at Sep 20, 2012 at 6:12 am
    Thanks Krishnan.

    Then I'm guessing support is there but usability is spotty and your mileage
    may vary. Just as with many cross-browser automation issues. :(
    On Friday, August 24, 2012 6:51:25 AM UTC-7, Krishnan wrote:

    David/Darrell,

    From the total issues raised for SafariDriver :
    http://code.google.com/p/selenium/issues/list?can=1&q=browser%3DSafari+component%3DWebDriver+status%3ANew%2CAccepted%2CWorkingAsIntended%2CWontFix%2CNotFeasible%2CFixed&colspec=ID+Stars+Type+Status+Priority+Owner+Summary+Browser+Component&cells=tiles


    I found this : http://code.google.com/p/selenium/issues/detail?id=3945

    3945 doesn't talk about switching to iframes, but it does state this : "If
    an iframe is removed from the DOM after the SafariDriver<http://code.google.com/p/selenium/wiki/SafariDriver?can=1&q=browser%3DSafari%20component%3DWebDriver%20status%3ANew%2CAccepted%2CWorkingAsIntended%2CWontFix%2CNotFeasible%2CFixed&colspec=ID%20Stars%20Type%20Status%20Priority%20Owner%20Summary%20Browser%20Component>has focused on it, the driver will hang."

    which makes me believe that perhaps iframes support is there in
    SafariDriver

    Hope that helps !

    Thanks & Regards
    Krishnan Mahadevan

    "All the desirable things in life are either illegal, expensive, fattening
    or in love with someone else!"



    On Fri, Aug 24, 2012 at 5:51 PM, darrell <darrell....@gmail.com<javascript:>
    wrote:
    Hi David,

    I don't know if there is a logged issue. The moment it came out I got it
    and the release notes for it. It was stated in the release notes that
    frames were not supported. I had plenty of work in other areas. So I put
    Safari on the back burner until I could put a dent in the other issues.

    Darrell
    On Friday, 17 August 2012 18:46:35 UTC-4, David wrote:

    Thanks Darrell.

    Is there a logged issue for that lack of support? Or it assume bundled
    with the window open / alert issues?

    Good to have a reference tracked in the issues list.
    On Aug 16, 6:29 am, darrell wrote:
    SafariDriver does not support frames. This was a big problem for me.
    Approximately 45% of my customers are Safari/Mac users and my
    application uses iframes quite heavily. :(

    On Aug 15, 9:50 pm, David wrote:






    I haven't found anything about this topic yet, nor in the issue
    tracker, but came across the fact that one of the acceptance tests
    dealing with window and frame switching is skipped for Safari:
    http://selenium.googlecode.**com/svn/trunk/dotnet/test/**
    WebDriver.Common.<http://selenium.googlecode.com/svn/trunk/dotnet/test/WebDriver.Common.>..
    Would like to confirm, does SafariDriver support switchin frames/
    iframes? I can understand lack of support for window switching since
    it can't handle alerts and can't open new window (via javascript).
    But
    frames/iframes too?
    Calling something like
    driver.switchTo().frame(**driver.findElements(By.**tagName("iframe")).get(0));
    can return timeout exception with message Timed out awaiting
    response
    to command "switchToFrame" after 30002 ms
    Calling driver.switchTo().frame(0); can return WebDriverException
    with
    message 'undefined' is not an object (evaluating
    'a.contentWindow.document')
    I tried against different valid frames numbers (1, etc.) and it
    either
    returned same errors or that it couldn't find element of next
    command
    since it wasn't on the right frame.
    I haven't seen the iframe switching issue in FF or IE so far.
    --
    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/-/bRGyRlwIHbMJ.
    To post to this group, send email to webd...@googlegroups.com<javascript:>
    .
    To unsubscribe from this group, send email to
    webdriver+...@googlegroups.com <javascript:>.
    For more options, visit this group at
    http://groups.google.com/group/webdriver?hl=en.
    --
    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/-/n7Vm1uYx1DMJ.
    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.
  • Simon Stewart at Sep 20, 2012 at 11:14 am
    The SafariDriver has been written as a safari extension and uses (lots
    of JS). We'd love some help improving it.

    Simon
    On Thu, Sep 20, 2012 at 7:12 AM, David wrote:
    Thanks Krishnan.

    Then I'm guessing support is there but usability is spotty and your mileage
    may vary. Just as with many cross-browser automation issues. :(

    On Friday, August 24, 2012 6:51:25 AM UTC-7, Krishnan wrote:

    David/Darrell,

    From the total issues raised for SafariDriver :
    http://code.google.com/p/selenium/issues/list?can=1&q=browser%3DSafari+component%3DWebDriver+status%3ANew%2CAccepted%2CWorkingAsIntended%2CWontFix%2CNotFeasible%2CFixed&colspec=ID+Stars+Type+Status+Priority+Owner+Summary+Browser+Component&cells=tiles


    I found this : http://code.google.com/p/selenium/issues/detail?id=3945

    3945 doesn't talk about switching to iframes, but it does state this : "If
    an iframe is removed from the DOM after the SafariDriver has focused on it,
    the driver will hang."

    which makes me believe that perhaps iframes support is there in
    SafariDriver

    Hope that helps !

    Thanks & Regards
    Krishnan Mahadevan

    "All the desirable things in life are either illegal, expensive, fattening
    or in love with someone else!"


    On Fri, Aug 24, 2012 at 5:51 PM, darrell wrote:

    Hi David,

    I don't know if there is a logged issue. The moment it came out I got it
    and the release notes for it. It was stated in the release notes that frames
    were not supported. I had plenty of work in other areas. So I put Safari on
    the back burner until I could put a dent in the other issues.

    Darrell
    On Friday, 17 August 2012 18:46:35 UTC-4, David wrote:

    Thanks Darrell.

    Is there a logged issue for that lack of support? Or it assume bundled
    with the window open / alert issues?

    Good to have a reference tracked in the issues list.
    On Aug 16, 6:29 am, darrell wrote:
    SafariDriver does not support frames. This was a big problem for me.
    Approximately 45% of my customers are Safari/Mac users and my
    application uses iframes quite heavily. :(

    On Aug 15, 9:50 pm, David wrote:






    I haven't found anything about this topic yet, nor in the issue
    tracker, but came across the fact that one of the acceptance tests
    dealing with window and frame switching is skipped for Safari:
    Would like to confirm, does SafariDriver support switchin frames/
    iframes? I can understand lack of support for window switching since
    it can't handle alerts and can't open new window (via javascript).
    But
    frames/iframes too?
    Calling something like

    driver.switchTo().frame(driver.findElements(By.tagName("iframe")).get(0));
    can return timeout exception with message Timed out awaiting
    response
    to command "switchToFrame" after 30002 ms
    Calling driver.switchTo().frame(0); can return WebDriverException
    with
    message 'undefined' is not an object (evaluating
    'a.contentWindow.document')
    I tried against different valid frames numbers (1, etc.) and it
    either
    returned same errors or that it couldn't find element of next
    command
    since it wasn't on the right frame.
    I haven't seen the iframe switching issue in FF or IE so far.
    --
    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/-/bRGyRlwIHbMJ.
    To post to this group, send email to webd...@googlegroups.com.
    To unsubscribe from this group, send email to
    webdriver+...@googlegroups.com.

    For more options, visit this group at
    http://groups.google.com/group/webdriver?hl=en.
    --
    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/-/n7Vm1uYx1DMJ.

    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.
    --
    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.
  • Teresa P at Aug 27, 2014 at 12:04 pm
    I'm having the same issue with Safari with the Python extension. I'm on
    the latest version of selenium, the python library, as well as safari. Has
    anyone had any luck about a workaround for this issue? I've attempted
    using id's, index of the frame, the WebElement reference.... I'm running
    out of ideas!!

    Help!

    Thanks!
    On Wednesday, August 15, 2012 7:50:42 PM UTC-6, David wrote:

    I haven't found anything about this topic yet, nor in the issue
    tracker, but came across the fact that one of the acceptance tests
    dealing with window and frame switching is skipped for Safari:


    http://selenium.googlecode.com/svn/trunk/dotnet/test/WebDriver.Common.Tests/WindowSwitchingTest.cs

    Would like to confirm, does SafariDriver support switchin frames/
    iframes? I can understand lack of support for window switching since
    it can't handle alerts and can't open new window (via javascript). But
    frames/iframes too?

    Calling something like
    driver.switchTo().frame(driver.findElements(By.tagName("iframe")).get(0));
    can return timeout exception with message Timed out awaiting response
    to command "switchToFrame" after 30002 ms

    Calling driver.switchTo().frame(0); can return WebDriverException with
    message 'undefined' is not an object (evaluating
    'a.contentWindow.document')

    I tried against different valid frames numbers (1, etc.) and it either
    returned same errors or that it couldn't find element of next command
    since it wasn't on the right frame.

    I haven't seen the iframe switching issue in FF or IE so far.
    --
    You received this message because you are subscribed to the Google Groups "webdriver" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to webdriver+unsubscribe@googlegroups.com.
    To post to this group, send email to webdriver@googlegroups.com.
    Visit this group at http://groups.google.com/group/webdriver.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupwebdriver @
categorieswatir
postedAug 16, '12 at 1:50a
activeJan 21, '15 at 9:56a
posts16
users10
websitewatir.com

People

Translate

site design / logo © 2021 Grokbase