From bret at pettichord.com Wed Apr 25 11:43:59 2007 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 25 Apr 2007 10:43:59 -0500 Subject: [Wtr-development] Fwd: Watir Stability Issues In-Reply-To: References: Message-ID: Adam Esterline recently reported some stability issues with Watir on his blog. http://adamesterline.com/2007/04/23/watin-watir-and-selenium-reviewed/ Because of them, he decided to use Watin instead, which did not have these problems. I asked him for more information, and he provided the following. This is something that I would like to understand better. Bret ---------- Forwarded message ---------- From: Adam Esterline Date: Apr 25, 2007 6:33 AM Subject: Watir Stability Issues To: bret at pettichord.com Bret, Thanks for your comment on my blog. We were using Watir 1.4.1. We also tried upgrading to 1.5? and the same problem existed. We saw that accessing an element while the browser was busy caused the test to hang. This happened frequently for us as our site has lots of ajax calls. There are two differences between Watir and WatiN that really made the difference for our team. 1. Problem described above, WatiN does not seem to have this problem. May because the use a STA - check this link out for more information: http://watin.sourceforge.net/apartmentstateinfo.html. 2. WatiN waits and tries again if it cannot find the element on the page. This makes it much easier to code tests. I am not saying that WatiN is perfect, but these two things help us keep our repeatable/reliable. Below is an example of a watir test we wrote. Not sure that it will help, but I thought I would pass it along. If you have any other questions/comments, please let me know. open_browser_to_corporate_home_page beginning_count = result_count click_link 'Architectural Style' assert_browse_section_is_active 'Architectural Style' assert_none_of_the_check_boxes_is_selected assert_count_equals beginning_count click_check_box 'Contemporary' sleep 2 after_contemporary_count = result_count assert_count_less_than beginning_count assert_browse_section_contains 'Architectural Style', 'Contemporary' -- Adam Esterline http://adamesterline.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-development/attachments/20070425/04196f12/attachment.html From charley.baker at gmail.com Wed Apr 25 14:49:08 2007 From: charley.baker at gmail.com (Charley Baker) Date: Wed, 25 Apr 2007 12:49:08 -0600 Subject: [Wtr-development] Fwd: Watir Stability Issues In-Reply-To: References: Message-ID: I've started doing some work on Ajax tests. So far I'm using wait_until to poll for elements to exist as the DOM changes based on various events triggering. So far so good from what I've seen. I'm spending some time to read up on the links on the Watin site and downloaded the project with source. One issue they seem to have overcome is the cross site scripting problem mentioned in a previous post or Jira ticket. Polling for controls might be something they do across the board for better Ajax support. It might be something to consider for Watir as the world moves to Web 2.0. On a sidenote, I'm looking at testing IE7 and browser tabs. I haven't found any updated documentation on IE's com model on the MSDN site that will allow me to access tabs. Anyone come across this? It's also going to be an issue with FireFox, that I'll delay until I abstract the browser access enough to run any of four drivers - ie, ff, safari, and selenium. -Charley On 4/25/07, Bret Pettichord wrote: > > Adam Esterline recently reported some stability issues with Watir on his > blog. > > http://adamesterline.com/2007/04/23/watin-watir-and-selenium-reviewed/ > > Because of them, he decided to use Watin instead, which did not have these > problems. I asked him for more information, and he provided the following. > This is something that I would like to understand better. > > Bret > > ---------- Forwarded message ---------- > From: Adam Esterline > Date: Apr 25, 2007 6:33 AM > Subject: Watir Stability Issues > To: bret at pettichord.com > > Bret, > > Thanks for your comment on my blog. > > We were using Watir 1.4.1. We also tried upgrading to 1.5? and the > same problem existed. > > We saw that accessing an element while the browser was busy caused the > test to hang. This happened frequently for us as our site has lots > of ajax calls. > > There are two differences between Watir and WatiN that really made the > difference for our team. > > 1. Problem described above, WatiN does not seem to have this problem. > May because the use a STA - check this link out for more > information: http://watin.sourceforge.net/apartmentstateinfo.html. > 2. WatiN waits and tries again if it cannot find the element on the > page. This makes it much easier to code tests. > > I am not saying that WatiN is perfect, but these two things help us > keep our repeatable/reliable. > > Below is an example of a watir test we wrote. Not sure that it will > help, but I thought I would pass it along. > > If you have any other questions/comments, please let me know. > > open_browser_to_corporate_home_page > > beginning_count = result_count > > click_link 'Architectural Style' > > assert_browse_section_is_active 'Architectural Style' > assert_none_of_the_check_boxes_is_selected > assert_count_equals beginning_count > > click_check_box 'Contemporary' > sleep 2 > after_contemporary_count = result_count > assert_count_less_than beginning_count > > assert_browse_section_contains 'Architectural Style', > 'Contemporary' > > -- > Adam Esterline > http://adamesterline.com/ > > _______________________________________________ > Wtr-development mailing list > Wtr-development at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-development > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-development/attachments/20070425/ce678983/attachment-0001.html From J.vanMenen at databalk.nl Thu Apr 26 04:44:31 2007 From: J.vanMenen at databalk.nl (Jeroen van Menen) Date: Thu, 26 Apr 2007 10:44:31 +0200 Subject: [Wtr-development] Fwd: Watir Stability Issues In-Reply-To: References: Message-ID: <2A29FD26542C3F4895D9B9370CB2828703DB0E43@DB-Exchange01.DataBalk.local> Brett, Basically what I have done is make AJAX testing just as "easy" as testing pages doing postbacks. To make this work I removed the need to code explicitly that the test needs to wait until some control is or is not there. I'm not that good at coding ruby, but from reading the posts on the mailing lists I understand you need to write something like: wait_until(ie.textfield(:id, "textfieldid").exists, 30) ie.textfield(:id, "textfieldid").set("waited until the textfield existed") To make this work with WatiN you code: ie.TextField(Find.ById("elementid")).TypeText("waited until the textfield existed"); One could also code this if you need a longer timeout then 30 seconds ie.TextField(Find.ById("elementid")).WaitUntilExists(60); ie.TextField(Find.ById("elementid")).TypeText("waited until the textfield existed"); I think users of watir/watin don't always realise they use AJAX and how that influences their test code. That's why I moved the call to WaitUntilExists(30) (wait_until(check, 30)) into the WatiN framework (since it doesn't impact tests with pages that don't use AJAX, performance wise). This might be the reason people experience WatiN having better AJAX support. Jeroen http://watin.sourceforge.net ________________________________ Van: wtr-development-bounces at rubyforge.org [mailto:wtr-development-bounces at rubyforge.org] Namens Charley Baker Verzonden: woensdag 25 april 2007 20:49 Aan: Discussion of Watir versions under development Onderwerp: Re: [Wtr-development] Fwd: Watir Stability Issues I've started doing some work on Ajax tests. So far I'm using wait_until to poll for elements to exist as the DOM changes based on various events triggering. So far so good from what I've seen. I'm spending some time to read up on the links on the Watin site and downloaded the project with source. One issue they seem to have overcome is the cross site scripting problem mentioned in a previous post or Jira ticket. Polling for controls might be something they do across the board for better Ajax support. It might be something to consider for Watir as the world moves to Web 2.0. On a sidenote, I'm looking at testing IE7 and browser tabs. I haven't found any updated documentation on IE's com model on the MSDN site that will allow me to access tabs. Anyone come across this? It's also going to be an issue with FireFox, that I'll delay until I abstract the browser access enough to run any of four drivers - ie, ff, safari, and selenium. -Charley On 4/25/07, Bret Pettichord wrote: Adam Esterline recently reported some stability issues with Watir on his blog. http://adamesterline.com/2007/04/23/watin-watir-and-selenium-reviewed/ Because of them, he decided to use Watin instead, which did not have these problems. I asked him for more information, and he provided the following. This is something that I would like to understand better. Bret ---------- Forwarded message ---------- From: Adam Esterline < adam at esterlines.com > Date: Apr 25, 2007 6:33 AM Subject: Watir Stability Issues To: bret at pettichord.com Bret, Thanks for your comment on my blog. We were using Watir 1.4.1. We also tried upgrading to 1.5? and the same problem existed. We saw that accessing an element while the browser was busy caused the test to hang. This happened frequently for us as our site has lots of ajax calls. There are two differences between Watir and WatiN that really made the difference for our team. 1. Problem described above, WatiN does not seem to have this problem. May because the use a STA - check this link out for more information: http://watin.sourceforge.net/apartmentstateinfo.html. 2. WatiN waits and tries again if it cannot find the element on the page. This makes it much easier to code tests. I am not saying that WatiN is perfect, but these two things help us keep our repeatable/reliable. Below is an example of a watir test we wrote. Not sure that it will help, but I thought I would pass it along. If you have any other questions/comments, please let me know. open_browser_to_corporate_home_page beginning_count = result_count click_link 'Architectural Style' assert_browse_section_is_active 'Architectural Style' assert_none_of_the_check_boxes_is_selected assert_count_equals beginning_count click_check_box 'Contemporary' sleep 2 after_contemporary_count = result_count assert_count_less_than beginning_count assert_browse_section_contains 'Architectural Style', 'Contemporary' -- Adam Esterline http://adamesterline.com/ _______________________________________________ Wtr-development mailing list Wtr-development at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-development -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-development/attachments/20070426/b6f31aeb/attachment.html