!!

Welcome to Selenium Webdriver Forum

As a web user you can read and search through forum content. Once you have registered and signed you can post topics, post replies, set up watch lists, modify forum settings, and use private messaging.

Author Topic: AJAX & IFrames  (Read 1408 times)

alvins82@gmail.com

  • Web User
AJAX & IFrames
« on: February 21, 2012, 02:45:51 PM »
Hi guys,
 I have been working on using webdriver with a website I work on
 utilizing AJAX and IFrames (read: lightboxes). At the moment webdriver
 doesn't block on AJAX or IFrames (not saying it should) so in order to
 support this I have made some helper classes which assist with this.
 Not sure if this is the best way to do it so I was wondering if
 anybody else has done some work/testing on using webdriver with AJAX/
 IFrames?
 
Cheers,
 Alvin

Offline Ana Stavreva

  • Sr. Member
  • ****
  • Posts: 253
Re: AJAX & IFrames
« Reply #1 on: February 21, 2012, 02:46:05 PM »
Hi Alvin,
 Currently I use the Wait class from Selenium RC. It's not ideal, but
 it's better than nothing and is a workable solution until we have the
 time to implement blocking on AJAX properly. I'm a little surprised
 that we're not blocking on iframes loading --- we should be doing
 that. I'll dig in and see if there's anything obvious that we
 should/could be doing (unless someone else wants to do that instead?)
 
Regards,
 
Simon
 

- Show quoted text -

alvins82@gmail.com

  • Web User
Re: AJAX & IFrames
« Reply #2 on: February 21, 2012, 02:46:13 PM »
Yeah that is exactly what I did. I have used selenium before (http://
 www.alvinsingh.org/blog/2008/05/automate-website-testing-with-seleniu...)
 so reused most of what I learned there. On the IFrame issue - I seem
 to have to call switchTo twice - I am not exactly sure why but calling
 it once never works.
 btw. It's great to see some great developers in Sydney doing some
 cutting edge stuff in the community. Also, the PageObject pattern is
 excellent - great job.
 
On Jul 11, 6:49 pm, "Simon Stewart" <simon.m.stew...@gmail.com> wrote:
 

- Show quoted text -

Selenium Webdriver

Re: AJAX & IFrames
« Reply #2 on: February 21, 2012, 02:46:13 PM »

Offline Ana Stavreva

  • Sr. Member
  • ****
  • Posts: 253
Re: AJAX & IFrames
« Reply #3 on: February 21, 2012, 02:46:21 PM »
Hi Alvin,
 WebDriver's behaviour when issuing commands is to see if the frame
 which the user last switched to still exists. If it doesn't, then we
 assume that a new page has loaded with the target set to "_top" and
 that we should be focusing on the default content of the page. It's
 possible that if you're using the "Wait" class and it accesses the
 page before it's finished loading, the frameset or iframe isn't
 present and so we reset the frame to send commands to. Not sure if
 that's actually what's happening, but it seems like a reasonable idea.
 
Thank you for the kind words about webdriver. It's appreciated. I'm
 now back in London, but there are people in Sydney who send me
 patches, so there's still some good Aussie involvment in the project
 :)
 
Regards,
 
Simon
 

- Show quoted text -

alvins82@gmail.com

  • Web User
Re: AJAX & IFrames
« Reply #4 on: February 21, 2012, 02:46:29 PM »
Ahh.. I see. I suspect you are probably right - since IFrame is non-
 blocking  I have to call wait which exposes this issue.
 On Jul 14, 3:33 am, "Simon Stewart" <simon.m.stew...@gmail.com> wrote:
 

- Show quoted text -

 

Related Topics

  Subject / Started by Replies Last post
8 Replies
1852 Views
Last post February 23, 2012, 07:31:28 PM
by David Byron
5 Replies
1545 Views
Last post March 28, 2012, 03:35:56 PM
by Simon Stewart
3 Replies
1282 Views
Last post March 28, 2012, 03:37:55 PM
by Danny Leblond
3 Replies
1219 Views
Last post March 28, 2012, 04:13:36 PM
by Simon Stewart
2 Replies
1773 Views
Last post April 10, 2012, 04:25:43 PM
by Nick Klauer
0 Replies
1565 Views
Last post October 30, 2012, 05:52:53 AM
by sriranjini
2 Replies
749 Views
Last post May 23, 2013, 09:10:33 AM
by yugandhar87