From jason at jrandolph.com Tue Jul 3 14:24:07 2007 From: jason at jrandolph.com (Jason Huggins) Date: Tue, 3 Jul 2007 11:24:07 -0700 Subject: [SafariWatir-general] version 0.2.4 and Safari 3 support - what was the fix? Message-ID: <53b9568a0707031124ned4bedi3f9648c78fbe28cb@mail.gmail.com> On Jun 23, Dave Hoover wrote: > I've released a new version of SafariWatir (0.2.4), which should play > nice with Safari 3. Hi! What was the fix in 0.2.4 that fixed Safari 3 support? Does "do JavaScript" work now, or did you use a workaround. -Jason (Hello from Selenium-land!) Huggins From dave at obtiva.com Tue Jul 3 15:04:32 2007 From: dave at obtiva.com (Dave Hoover) Date: Tue, 3 Jul 2007 14:04:32 -0500 Subject: [SafariWatir-general] version 0.2.4 and Safari 3 support - what was the fix? In-Reply-To: <53b9568a0707031124ned4bedi3f9648c78fbe28cb@mail.gmail.com> References: <53b9568a0707031124ned4bedi3f9648c78fbe28cb@mail.gmail.com> Message-ID: <11c8704e0707031204v43319aabkff4eafe67798bbb3@mail.gmail.com> On 7/3/07, Jason Huggins wrote: > On Jun 23, Dave Hoover wrote: > > I've released a new version of SafariWatir (0.2.4), which should play > > nice with Safari 3. > > Hi! What was the fix in 0.2.4 that fixed Safari 3 support? Does "do > JavaScript" work now, or did you use a workaround. The fix was that in Safari 3, it's stricter about its implementation of JavaScript. Specifically, JavaScript doesn't allow you to use 'return' from anywhere other than a function, and I was using them in 'main' to short circuit execution for certain situations. So I wrapped everything in an anonymous function to minimize the changes I had to make in my code. Here's the crux of the fix: %|(function() { #{script} })()| # see line 35 in safariwatir/scripter.rb > -Jason (Hello from Selenium-land!) Huggins --Dave /waving to Selenium-land from Watir-world From jason at jrandolph.com Tue Jul 3 20:06:16 2007 From: jason at jrandolph.com (Jason Huggins) Date: Tue, 3 Jul 2007 17:06:16 -0700 Subject: [SafariWatir-general] version 0.2.4 and Safari 3 support - what was the fix? In-Reply-To: <11c8704e0707031204v43319aabkff4eafe67798bbb3@mail.gmail.com> References: <53b9568a0707031124ned4bedi3f9648c78fbe28cb@mail.gmail.com> <11c8704e0707031204v43319aabkff4eafe67798bbb3@mail.gmail.com> Message-ID: <53b9568a0707031706mdd5c20ap2e51fd52e5b2194c@mail.gmail.com> On 7/3/07, Dave Hoover wrote: .... ... > --Dave /waving to Selenium-land from Watir-world Thanks, Dave! :-) - Jason /wishing every browser had a "do JavaScript" command available from the command line. :-) From dave at obtiva.com Tue Jul 3 23:04:04 2007 From: dave at obtiva.com (Dave Hoover) Date: Tue, 3 Jul 2007 22:04:04 -0500 Subject: [SafariWatir-general] Bug report: unable to set text_field with numeric value In-Reply-To: References: Message-ID: <11c8704e0707032004v326d2140y85e98ef070644505@mail.gmail.com> I was only able to replicate this problem if I actually passed a Numeric into the set method. So this works for me: browser.text_field(:name, "example").set("1182816195") But this doesn't: browser.text_field(:name, "example").set(1182816195) I will make this a bit more forgiving (by calling value.to_s), but it doesn't really make much sense to pass anything other than a String into the set method. On 6/25/07, Kyle Campos wrote: > TextField class does a .length on the value passed and that fails if the > value is numeric. If you pass browser.text_field(:name, > "example").set("1182816195") you will get the following error: > > test_login(Acceptance): > NoMethodError: undefined method `length' for 1182816195:Bignum > method set in safariwatir.rb at line 299 > method instance_eval in scripter.rb at line 158 > method highlight in scripter.rb at line 158 > method set in safariwatir.rb at line 297 > method enroll_user in qatest_controller.rb at line 48 > method test_login in login.rb at line 23 > > ------------ > > class TextField < InputElement > def set(value) > @ scripter.focus(self) > @scripter.highlight(self) do > clear_text_input > 299> value.length.times do |i| > append_text_input(value[i, 1]) > end > end > @ scripter.blur(self) > end > > _______________________________________________ > SafariWatir-general mailing list > SafariWatir-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/safariwatir-general > From dave at obtiva.com Wed Jul 4 00:09:05 2007 From: dave at obtiva.com (Dave Hoover) Date: Tue, 3 Jul 2007 23:09:05 -0500 Subject: [SafariWatir-general] Unable to select from select lists with a blank default value In-Reply-To: References: Message-ID: <11c8704e0707032109k2b8f3834l54989a0723d21e33@mail.gmail.com> This has been fixed. Please grab the latest SafariWatir gem. On 6/26/07, Kyle Campos wrote: > I'm seeing an issue where I'm unable to select an option from select lists > that have a blank default value. Here's the select code: > > > > None of the following watir code will work: > > @browser.select_list(:name, > "user[gender]").select_value("M") > @browser.select_list(:name, > "user[gender]").select_value("M=Male") > @browser.select_list(:name, "user[gender]").select("Male") > > I don't get an error it just moves along as if it selected, but it doesn't > do anything. Similar code with select lists in the same form that don't have > a blank default value work fine. > > Any ideas? > > -Kyle > > _______________________________________________ > SafariWatir-general mailing list > SafariWatir-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/safariwatir-general > From kcampos at bioiq.com Thu Jul 5 22:45:55 2007 From: kcampos at bioiq.com (Kyle Campos) Date: Thu, 5 Jul 2007 19:45:55 -0700 Subject: [SafariWatir-general] Unable to select from select lists with a blank default value In-Reply-To: <11c8704e0707032109k2b8f3834l54989a0723d21e33@mail.gmail.com> References: <11c8704e0707032109k2b8f3834l54989a0723d21e33@mail.gmail.com> Message-ID: Thanks that did it. -Kyle On 7/3/07, Dave Hoover wrote: > > This has been fixed. Please grab the latest SafariWatir gem. > > On 6/26/07, Kyle Campos wrote: > > I'm seeing an issue where I'm unable to select an option from select > lists > > that have a blank default value. Here's the select code: > > > > > > > > None of the following watir code will work: > > > > @browser.select_list(:name, > > "user[gender]").select_value("M") > > @browser.select_list(:name, > > "user[gender]").select_value("M=Male") > > @browser.select_list(:name, "user[gender]").select("Male") > > > > I don't get an error it just moves along as if it selected, but it > doesn't > > do anything. Similar code with select lists in the same form that don't > have > > a blank default value work fine. > > > > Any ideas? > > > > -Kyle > > > > _______________________________________________ > > SafariWatir-general mailing list > > SafariWatir-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/safariwatir-general > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/safariwatir-general/attachments/20070705/f82fea4d/attachment.html From kcampos at bioiq.com Thu Jul 5 22:49:17 2007 From: kcampos at bioiq.com (Kyle Campos) Date: Thu, 5 Jul 2007 19:49:17 -0700 Subject: [SafariWatir-general] browser loads and clicks/submits not waiting for browser to load before proceeding Message-ID: I'm getting errors where the next command doesn't see an identifier and that's because the browser hasn't finished loading the page yet from the previous command. Are there any sort of "and_wait" or "wait_for" type of methods that can be used? Thanks -Kyle -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/safariwatir-general/attachments/20070705/b14099b7/attachment.html From dave at obtiva.com Fri Jul 6 00:42:59 2007 From: dave at obtiva.com (Dave Hoover) Date: Thu, 5 Jul 2007 23:42:59 -0500 Subject: [SafariWatir-general] browser loads and clicks/submits not waiting for browser to load before proceeding In-Reply-To: References: Message-ID: <11c8704e0707052142k1aebff7u77a9ea0cf97ffe5b@mail.gmail.com> No, there are no and_wait or wait_for methods. Watir should wait until the page loads before it continues to execute and this is an area of SafariWatir that needs some attention. Can you give me some code as an example? On 7/5/07, Kyle Campos wrote: > I'm getting errors where the next command doesn't see an identifier and > that's because the browser hasn't finished loading the page yet from the > previous command. Are there any sort of "and_wait" or "wait_for" type of > methods that can be used? > > Thanks > -Kyle > > _______________________________________________ > SafariWatir-general mailing list > SafariWatir-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/safariwatir-general > From kcampos at bioiq.com Fri Jul 6 13:09:18 2007 From: kcampos at bioiq.com (Kyle Campos) Date: Fri, 6 Jul 2007 10:09:18 -0700 Subject: [SafariWatir-general] browser loads and clicks/submits not waiting for browser to load before proceeding In-Reply-To: <11c8704e0707052142k1aebff7u77a9ea0cf97ffe5b@mail.gmail.com> References: <11c8704e0707052142k1aebff7u77a9ea0cf97ffe5b@mail.gmail.com> Message-ID: Sure, a simple browser load and then click on a link: #get_url returns a http string @browser.goto(get_url) @browser.link(:text, "Sign-up Now").click The second cmd will error with: 1) Error: test_fulfill_order(Acceptance): Watir::Exception::UnknownObjectException: Unable to locate Link element with text of Sign-up Now If I add a sleep inbetween the steps of some arbitrary length to allow time for the browser to load, then it succeeds. But obviously setting arbitrary sleeps stinks. -Kyle On 7/5/07, Dave Hoover wrote: > > No, there are no and_wait or wait_for methods. Watir should wait > until the page loads before it continues to execute and this is an > area of SafariWatir that needs some attention. Can you give me some > code as an example? > > On 7/5/07, Kyle Campos wrote: > > I'm getting errors where the next command doesn't see an identifier and > > that's because the browser hasn't finished loading the page yet from the > > previous command. Are there any sort of "and_wait" or "wait_for" type of > > methods that can be used? > > > > Thanks > > -Kyle > > > > _______________________________________________ > > SafariWatir-general mailing list > > SafariWatir-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/safariwatir-general > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/safariwatir-general/attachments/20070706/bd62c71d/attachment.html From bmintun at apple.com Sun Jul 8 14:55:48 2007 From: bmintun at apple.com (Brian Mintun) Date: Sun, 8 Jul 2007 11:55:48 -0700 Subject: [SafariWatir-general] How to enter text in a drop down authentication box from within a safari-watir script? Message-ID: <0D28C7B5-C148-40C6-AAA5-508EEC843573@apple.com> Hi all, I was wondering if anyone had some instructions on how to enter text in a drop down authentication box from within a safari-watir script? I cannot seem to figure this out... Thanks, Brian From jdonagher at gmail.com Tue Jul 10 03:29:13 2007 From: jdonagher at gmail.com (John Donagher) Date: Tue, 10 Jul 2007 00:29:13 -0700 Subject: [SafariWatir-general] browser loads and clicks/submits not waiting for browser to load before proceeding In-Reply-To: References: <11c8704e0707052142k1aebff7u77a9ea0cf97ffe5b@mail.gmail.com> Message-ID: I have observed the same - I figured the wait logic simply wasn't implemented for safariwatir. My specific example was some automation I was adding on top of a bugzilla install - nothing too complex as far as the DOM is concerned. Dave, if you need more info, I can provide it. For me, it's not a huge problem since it can be worked around with sleep()'s (although it may impede adoption of safariwatir by others somewhat) Thanks, John On 7/6/07, Kyle Campos wrote: > Sure, a simple browser load and then click on a link: > > #get_url returns a http string > @browser.goto(get_url) > > @browser.link(:text, "Sign-up Now").click > > The second cmd will error with: > > 1) Error: > test_fulfill_order(Acceptance): > Watir::Exception::UnknownObjectException: Unable to locate > Link element with text of Sign-up Now > > If I add a sleep inbetween the steps of some arbitrary length to allow time > for the browser to load, then it succeeds. But obviously setting arbitrary > sleeps stinks. > -Kyle > > > On 7/5/07, Dave Hoover wrote: > > No, there are no and_wait or wait_for methods. Watir should wait > > until the page loads before it continues to execute and this is an > > area of SafariWatir that needs some attention. Can you give me some > > code as an example? > > > > On 7/5/07, Kyle Campos wrote: > > > I'm getting errors where the next command doesn't see an identifier and > > > that's because the browser hasn't finished loading the page yet from the > > > previous command. Are there any sort of "and_wait" or "wait_for" type of > > > methods that can be used? > > > > > > Thanks > > > -Kyle > > > > > > _______________________________________________ > > > SafariWatir-general mailing list > > > SafariWatir-general at rubyforge.org > > > > http://rubyforge.org/mailman/listinfo/safariwatir-general > > > > > > > > _______________________________________________ > SafariWatir-general mailing list > SafariWatir-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/safariwatir-general > From dave at obtiva.com Tue Jul 10 08:23:05 2007 From: dave at obtiva.com (Dave Hoover) Date: Tue, 10 Jul 2007 07:23:05 -0500 Subject: [SafariWatir-general] browser loads and clicks/submits not waiting for browser to load before proceeding In-Reply-To: References: <11c8704e0707052142k1aebff7u77a9ea0cf97ffe5b@mail.gmail.com> Message-ID: <11c8704e0707100523t675d35ebocaa984e47e4f51a9@mail.gmail.com> This problem has been reported before, and unfortunately, it is not consistent across safariwatir installs. For instance, I've never seen the problem on my MacBook Pro, though I have heard reports of this problem on other people's MacBook Pros (and MacBooks). It's obviously difficult for me to get to the heart of this problem without being able to replicate it. I'll have another go at replicating the problem on some other Macs in the office. --Dave On 7/10/07, John Donagher wrote: > I have observed the same - I figured the wait logic simply wasn't > implemented for safariwatir. > > My specific example was some automation I was adding on top of a > bugzilla install - nothing too complex as far as the DOM is concerned. > > Dave, if you need more info, I can provide it. For me, it's not a huge > problem since it can be worked around with sleep()'s (although it may > impede adoption of safariwatir by others somewhat) > > Thanks, > John > > On 7/6/07, Kyle Campos wrote: > > Sure, a simple browser load and then click on a link: > > > > #get_url returns a http string > > @browser.goto(get_url) > > > > @browser.link(:text, "Sign-up Now").click > > > > The second cmd will error with: > > > > 1) Error: > > test_fulfill_order(Acceptance): > > Watir::Exception::UnknownObjectException: Unable to locate > > Link element with text of Sign-up Now > > > > If I add a sleep inbetween the steps of some arbitrary length to allow time > > for the browser to load, then it succeeds. But obviously setting arbitrary > > sleeps stinks. > > -Kyle > > > > > > On 7/5/07, Dave Hoover wrote: > > > No, there are no and_wait or wait_for methods. Watir should wait > > > until the page loads before it continues to execute and this is an > > > area of SafariWatir that needs some attention. Can you give me some > > > code as an example? > > > > > > On 7/5/07, Kyle Campos wrote: > > > > I'm getting errors where the next command doesn't see an identifier and > > > > that's because the browser hasn't finished loading the page yet from the > > > > previous command. Are there any sort of "and_wait" or "wait_for" type of > > > > methods that can be used? > > > > > > > > Thanks > > > > -Kyle > > > > > > > > _______________________________________________ > > > > SafariWatir-general mailing list > > > > SafariWatir-general at rubyforge.org > > > > > > http://rubyforge.org/mailman/listinfo/safariwatir-general > > > > > > > > > > > > > _______________________________________________ > > SafariWatir-general mailing list > > SafariWatir-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/safariwatir-general > > > _______________________________________________ > SafariWatir-general mailing list > SafariWatir-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/safariwatir-general > From robd at robd.co.uk Tue Jul 17 11:47:11 2007 From: robd at robd.co.uk (Rob Dupuis) Date: Tue, 17 Jul 2007 16:47:11 +0100 Subject: [SafariWatir-general] Clicking links found by id not working Message-ID: <8DCA1171-720A-4F0B-9A87-29499A1B086D@robd.co.uk> Hi. I was wondering if anyone else has seen any problems with clicking on links found by id. Or have I screwed something up? In my test, when I do @safari.link(:text, 'google link text').click I successfully get redirected to google If I do @safari.link(:id, 'link-to-google').click The element is highlighted in safari, but is not clicked. The browser just remain on the same page. Thanks, Rob From robd at robd.co.uk Tue Jul 17 14:17:21 2007 From: robd at robd.co.uk (Rob Dupuis) Date: Tue, 17 Jul 2007 19:17:21 +0100 Subject: [SafariWatir-general] Javascript alert OK clicking not working Message-ID: <690C468F-4FAD-42F1-967E-19F1E8D3299B@robd.co.uk> Hi. I don't seem to be able to get support for javascript alert boxes working. When I click on a link with a javascript alert() the test just blocks on the line where I click the link. It doesn't seem to make it to the next line where I'm trying to call @safari.alert.click I think this might be something to do with the fact that links are clicked via javascript. Could it be that the javascript for following the link cannot return because it is blocking on the alert box. I've also tried evaluating the link in its own thread, but I think there's something single threaded (AppScript somewhere?) which still blocks my call to safari.alert.click. Is anyone using safari.alert.click successfully? Thanks, Rob From safariwatir at robd.co.uk Wed Jul 18 06:07:22 2007 From: safariwatir at robd.co.uk (Rob Dupuis) Date: Wed, 18 Jul 2007 11:07:22 +0100 Subject: [SafariWatir-general] Clicking links found by id not working References: <8DCA1171-720A-4F0B-9A87-29499A1B086D@robd.co.uk> Message-ID: <77F05183-D099-4A7F-B242-DA703471A170@robd.co.uk> Hi. I was wondering if anyone else has seen any problems with clicking on links found by id. Or have I screwed something up? In my test, when I do @safari.link(:text, 'google link text').click I successfully get redirected to google If I do @safari.link(:id, 'link-to-google').click The element is highlighted in safari for about a second, but is not clicked. The browser just remains on the same page. Thanks, Rob From safariwatir at robd.co.uk Wed Jul 18 06:09:16 2007 From: safariwatir at robd.co.uk (Rob Dupuis) Date: Wed, 18 Jul 2007 11:09:16 +0100 Subject: [SafariWatir-general] Javascript alert OK clicking not working References: <690C468F-4FAD-42F1-967E-19F1E8D3299B@robd.co.uk> Message-ID: <7E650790-C33E-47CE-AA3F-3E82C2B10A24@robd.co.uk> Hi. I don't seem to be able to get support for javascript alert boxes working. When I click on a link with a javascript alert() the test just blocks on the line where I click the link. It doesn't seem to make it to the next line where I'm trying to call @safari.alert.click I think this might be something to do with the fact that links are clicked via javascript. Could it be that the javascript for following the link cannot return because it is blocking on the alert box. I've also tried evaluating the link in its own thread, but I think there's something single threaded (AppScript somewhere?) which still blocks my call to safari.alert.click. Is anyone using safari.alert.click successfully? Thanks, Rob From dave at obtiva.com Wed Jul 18 07:23:31 2007 From: dave at obtiva.com (Dave Hoover) Date: Wed, 18 Jul 2007 06:23:31 -0500 Subject: [SafariWatir-general] Javascript alert OK clicking not working In-Reply-To: <7E650790-C33E-47CE-AA3F-3E82C2B10A24@robd.co.uk> References: <690C468F-4FAD-42F1-967E-19F1E8D3299B@robd.co.uk> <7E650790-C33E-47CE-AA3F-3E82C2B10A24@robd.co.uk> Message-ID: <11c8704e0707180423w30b6a660qa1789c8b78c88143@mail.gmail.com> Try going to System Preferences > Universal Access > check "Enable access for assistive devices" On 7/18/07, Rob Dupuis wrote: > Hi. > > I don't seem to be able to get support for javascript alert boxes > working. When I click on a link with a javascript alert() the test > just blocks on the line where I click the link. It doesn't seem to > make it to the next line where I'm trying to call @safari.alert.click > > I think this might be something to do with the fact that links are > clicked via javascript. Could it be that the javascript for following > the link cannot return because it is blocking on the alert box. > > I've also tried evaluating the link in its own thread, but I think > there's something single threaded (AppScript somewhere?) which still > blocks my call to safari.alert.click. > > Is anyone using safari.alert.click successfully? > > Thanks, > Rob > > _______________________________________________ > SafariWatir-general mailing list > SafariWatir-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/safariwatir-general >