Re: [wtr-general] Re: Javascript pop uo using firewatir
Hi, I tried the code using without the codes but it is showing an error. syntax error, unexpected tINTEGER, expecting ')' Browser.link(:href, /users/1).click But if i put the codes then error is not displayed but the link is getting clicked. On Mon, Nov 22, 2010 at 7:16 PM, Prajakta Jadhav jadhav.praja...@gmail.comwrote: Why does Browser.link(:href,/users/1).click have double quotes ( ) around :href? That is not required and I am not sure if that will work either. This is the syntax: a href=page.htm ie.link(:href, /page/).click Try removing those double quotes. Hope it works. 2010/11/22 Amit Kulkarni amitkkulkarni...@gmail.com Thanks a lot for the link. But i tried every option but no success. If you see carefully it uses a Ajax call. require 'rubygems' require 'firewatir' Watir::Browser.default = 'firefox' Browser = Watir::Browser.new Browser.goto(http://localhost:3000/users;) Browser.link(:href,/users/1).click --error referring to this line #Browser.execute_script(window.confirm = function() {return true}) def check_for_popups autoit = WIN32OLE.new('AutoItX3.Control') # # Do forever - assumes popups could occur anywhere/anytime in your application. loop do # Look for window with given title. Give up after 1 second. ret = autoit.WinWait('Destroy', '', 1) # # If window found, send appropriate keystroke (e.g. {enter}, {Y}, {N}). if (ret==1) then autoit.Send('{enter}') end # # Take a rest to avoid chewing up cycles and give another thread a go. # Then resume the loop. sleep(3) end end $popup = Thread.new { check_for_popups } # start popup handler at_exit { Thread.kill($popup) } After running i get the following error js_eval': missing ; before statement (JsshSocket::JSSyntaxError) from /var/lib/gems/1.8/gems/firewatir-1.6.7/lib/firewatir/jssh_socket.rb:27:in `js_eval_method' from /var/lib/gems/1.8/gems/firewatir-1.6.7/lib/firewatir/element.rb:936:in `enabled?' from /var/lib/gems/1.8/gems/firewatir-1.6.7/lib/firewatir/element.rb:922:in `assert_enabled' from /var/lib/gems/1.8/gems/firewatir-1.6.7/lib/firewatir/element.rb:1072:in `click' from user_destroy.rb:6 On Thu, Nov 18, 2010 at 2:36 PM, Željko Filipin zeljko.fili...@wa-research.ch wrote: On Thu, Nov 18, 2010 at 8:21 AM, Amit Kulkarni amitkkulkarni...@gmail.com wrote: On delete action popup is there which onclick it shows a pop up box along with two buttons i.e. Ok and Cancel Maybe something from here could help you: http://wiki.openqa.org/display/WTR/Pop+Ups http://wiki.openqa.org/display/WTR/JavaScript+Pop+Ups Željko -- watir.com - community manager watirpodcast.com - host testingpodcast.com - audio podcasts on software testing. all of them -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Re: Javascript pop uo using firewatir
Hi, I tried the code but it gives me error as gem_original_require': no such file to load -- win32ole (MissingSourceFile) I am working on Ubuntu machine so could not install the windows gem. How to solve this? 2010/11/23 Rajiv Nanduani rajivkumarnandv...@gmail.com try this $autoit = WIN32OLE.new(AutoItX3.Control) sleep(5) if @browserType == firefox Thread.start do @browser.link(:href, /page/).click end sleep(5) elsif @browserType == ie Thread.start do @browser.link(:href, /page/).focus end sleep(5) $autoit.Send({ENTER}) else @@log.error(@browserType + is NOT a valid Browser Type!!!) raise Exception.new(@browserType + is NOT a valid Browser Type!) end sleep(5) $autoit.Send({ENTER}) sleep(5) On Mon, Nov 22, 2010 at 8:46 AM, Prajakta Jadhav jadhav.praja...@gmail.com wrote: Why does Browser.link(:href,/users/1).click have double quotes ( ) around :href? That is not required and I am not sure if that will work either. This is the syntax: a href=page.htm ie.link(:href, /page/).click Try removing those double quotes. Hope it works. 2010/11/22 Amit Kulkarni amitkkulkarni...@gmail.com Thanks a lot for the link. But i tried every option but no success. If you see carefully it uses a Ajax call. require 'rubygems' require 'firewatir' Watir::Browser.default = 'firefox' Browser = Watir::Browser.new Browser.goto(http://localhost:3000/users;) Browser.link(:href,/users/1).click --error referring to this line #Browser.execute_script(window.confirm = function() {return true}) def check_for_popups autoit = WIN32OLE.new('AutoItX3.Control') # # Do forever - assumes popups could occur anywhere/anytime in your application. loop do # Look for window with given title. Give up after 1 second. ret = autoit.WinWait('Destroy', '', 1) # # If window found, send appropriate keystroke (e.g. {enter}, {Y}, {N}). if (ret==1) then autoit.Send('{enter}') end # # Take a rest to avoid chewing up cycles and give another thread a go. # Then resume the loop. sleep(3) end end $popup = Thread.new { check_for_popups } # start popup handler at_exit { Thread.kill($popup) } After running i get the following error js_eval': missing ; before statement (JsshSocket::JSSyntaxError) from /var/lib/gems/1.8/gems/firewatir-1.6.7/lib/firewatir/jssh_socket.rb:27:in `js_eval_method' from /var/lib/gems/1.8/gems/firewatir-1.6.7/lib/firewatir/element.rb:936:in `enabled?' from /var/lib/gems/1.8/gems/firewatir-1.6.7/lib/firewatir/element.rb:922:in `assert_enabled' from /var/lib/gems/1.8/gems/firewatir-1.6.7/lib/firewatir/element.rb:1072:in `click' from user_destroy.rb:6 On Thu, Nov 18, 2010 at 2:36 PM, Željko Filipin zeljko.fili...@wa-research.ch wrote: On Thu, Nov 18, 2010 at 8:21 AM, Amit Kulkarni amitkkulkarni...@gmail.com wrote: On delete action popup is there which onclick it shows a pop up box along with two buttons i.e. Ok and Cancel Maybe something from here could help you: http://wiki.openqa.org/display/WTR/Pop+Ups http://wiki.openqa.org/display/WTR/JavaScript+Pop+Ups Željko -- watir.com - community manager watirpodcast.com - host testingpodcast.com - audio podcasts on software testing. all of them -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- RAJIV KUMAR http://rajivkumarnandvani.wordpress.com/ http://learnqtphelp.blogspot.com/ -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read
[wtr-general] Watir Console issues
Hey Everyone, I try to fire up watir-console and I get the following error: C:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.7/lib/watir/irb-history.rb: 3:TypeError: History is not a module I am using ruby 1.8.7 (2010-08-16 patchlevel 302) [i386-mingw32] and Gem version 1.3.7 on a Windows XP machine. Any help would be greatly appreciated :) -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
[wtr-general] new bie question - calling many test script from a single one
Hi All, I am working on modifying existing watir scripts, which are written in the below format. method_func1.rb , method-func2.rb and so on... Each of these scripts have many methods which use assertions as required, however these scripts are NOT test cases i.e they do NOT extend Watir::TestCase For testing these, there is a single test class written as below- class TS_Smoke Watir::TestCase def test_smoke func1 = Func1.new func1.someMethod func2 = Func2.new func2.someMethod .. end end The problem with this is that I am not able to test the different functionality independently , i.e testing only method_funnc1.rb and not the other scripts. Is there a way by which we can create test script for each module (i.e extend Watir::TestCase) and then have a suite(like the one used in JUnit) from which to execute these test cases? And, I also believe that the best place to use assertion is in the test class and not in normal ruby class - please correct me if I am wrong Regards, Joshua -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Re: Option in select
On Wed, Nov 24, 2010 at 1:43 AM, Shlomit Gazit shlomitpatr...@gmail.com wrote: Should I be able to do it with xpath? Probably. Željko -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Option in select
On Tue, Nov 23, 2010 at 8:47 PM, Shlomit Gazit shlomitpatr...@gmail.com wrote: Is there an option to use title for option? This is the html code: option id=http://semanticweb.databaserepublic.com/c2p/systemData/ searchField#attachmentTargetItself value=341 title=true,Inner Search,^50$|^62$|^56$,attachmentTargetItselfAttachment::/option Did you try? Željko -- watir.com - community manager watirpodcast.com - host testingpodcast.com - audio podcasts on software testing. all of them -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
[wtr-general] Re: click_no_wait fails for button to open modal dialog (Win XP, Ruby 1.8.6.26, Watir 1.6.7)
Hi Kushal, I'm having exactly the same problem and I have not found a working solution. I have a need to open and interact with a modal dialog. However, click_no_wait simply returns nil. -- A. Vuori On 21 marras, 20:29, Kushal kushal...@gmail.com wrote: Hi all, I am stuck in this problem for three days now. I need to open a modal dialog from a button on a webpage. When I use click or fire_event(onclick), execution just hangs. This is understandable as it waits for work to be completed on the modal dialog. Therefore, I am trying to useclick_no_wait, but it returns nil. I made some changes in theclick_no_waitfunction, to display the call by adding puts command on line 249 and replaced start rubyw #{command} with rubyw #{command} I get the following error on the console: c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.7/lib/watir/element.rb:58:in `assert_exists': Unable to locate element, using :unique_number, 1 (Watir::Exception::UnknownObjectException) from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.7/lib/watir/ element.rb:263 :in `click!' from -e:1 The command that is executed in the above call is: ruby -e require 'rubygems';require 'c:/ruby/lib/ruby/gems/1.8/gems/ watir-1.6.7/lib/watir/core';Watir::Button.new(Watir::IE.attach(:hwnd, 656538), :unique_number, 1).click! Also, I read this article (http://jira.openqa.org/browse/WTR-144) which describes how fire_event_no_wait could be added to element.rb for fire_event(onmousedown) with no wait. However, eval_in_spawned_process method is not present in PageContainer module in Watir 1.6.7. Thanks. Kushal -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Re: Recent Stack Overflow Questions Tagged Watir
http://stackoverflow.com/questions/4264089/how-to-record-ssis-reports-in-ruby-watir http://stackoverflow.com/questions/4264210/how-to-select-a-value-from-dropdown http://stackoverflow.com/questions/4264531/watir-web-testing-is-not-working-if-the-site-is-taking-some-time-to-load -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
[wtr-general] Navigating between tabs in same browser instance
Hi All, I want to do some concurrent session testing which requires to open 2 tabs in a single browser window and navigate between them(after performing some actions in the application running in the tab), I was not able to find any suitable Watir API for the same. Is there any other way to achieve this ? Regards, Joshua -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Watir Console issues
I don't think watir console is maintained or really supported. I'd recommend just using normal irb and requiring watir. On Tue, Nov 23, 2010 at 12:04, enriquem enrique.j.ma...@gmail.com wrote: Hey Everyone, I try to fire up watir-console and I get the following error: C:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.7/lib/watir/irb-history.rb: 3:TypeError: History is not a module I am using ruby 1.8.7 (2010-08-16 patchlevel 302) [i386-mingw32] and Gem version 1.3.7 on a Windows XP machine. Any help would be greatly appreciated :) -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.comhttp://groups.google.com/group/watir-generalwatir-general+unsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
[wtr-general] Re: Converting Watir::Waiter.wait_until to element.wait_until
will start a new thread on the rdoc issue -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
[wtr-general] Rdoc for Wait and ElementExtensions in Watir 1.6.7
Hi, I cant find the rdoc for Watir::Wait and Watir::ElementExtensions. Can someone tell me how to generate it or where it is located locally in the ruby directories. Željko Filipin has also mentioned in another thread that its not found in http://rdoc.info/gems/watir/frames -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
[wtr-general] A solution to avoiding basic authentication dialogs
Hi, I've just written about a way to avoid the 'basic authentication' dialog boxes when using Watir. It's on the wiki: http://wiki.openqa.org/display/WTR/Basic+Authentication and my blog: http://watirmelon.com/2010/11/24/elegantly-handling-basic-browser-authentication-with-watir/ Cheers, Alister Alister Scott Brisbane, Australia Watir Web Master: http://watir.com Blog: http://watirmelon.com LinkedIn: http://www.linkedin.com/in/alisterscott -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Re: Javascript pop uo using firewatir
I'd try Watir-Webdriver and see if the execute_script code works. Browser.execute_script( window.confirm = function() {return true}) Cheers Alister Scott Brisbane, Australia Watir Web Master: http://watir.com Blog: http://watirmelon.com LinkedIn: http://www.linkedin.com/in/alisterscott There are two ways to get enough: One is to continue to accumulate more and more. The other is to desire less. *~ G. K. Chesterton* 2010/11/24 Amit Kulkarni amitkkulkarni...@gmail.com Hi, I tried the code but it gives me error as gem_original_require': no such file to load -- win32ole (MissingSourceFile) I am working on Ubuntu machine so could not install the windows gem. How to solve this? 2010/11/23 Rajiv Nanduani rajivkumarnandv...@gmail.com try this $autoit = WIN32OLE.new(AutoItX3.Control) sleep(5) if @browserType == firefox Thread.start do @browser.link(:href, /page/).click end sleep(5) elsif @browserType == ie Thread.start do @browser.link(:href, /page/).focus end sleep(5) $autoit.Send({ENTER}) else @@log.error(@browserType + is NOT a valid Browser Type!!!) raise Exception.new(@browserType + is NOT a valid Browser Type!) end sleep(5) $autoit.Send({ENTER}) sleep(5) On Mon, Nov 22, 2010 at 8:46 AM, Prajakta Jadhav jadhav.praja...@gmail.com wrote: Why does Browser.link(:href,/users/1).click have double quotes ( ) around :href? That is not required and I am not sure if that will work either. This is the syntax: a href=page.htm ie.link(:href, /page/).click Try removing those double quotes. Hope it works. 2010/11/22 Amit Kulkarni amitkkulkarni...@gmail.com Thanks a lot for the link. But i tried every option but no success. If you see carefully it uses a Ajax call. require 'rubygems' require 'firewatir' Watir::Browser.default = 'firefox' Browser = Watir::Browser.new Browser.goto(http://localhost:3000/users;) Browser.link(:href,/users/1).click --error referring to this line #Browser.execute_script(window.confirm = function() {return true}) def check_for_popups autoit = WIN32OLE.new('AutoItX3.Control') # # Do forever - assumes popups could occur anywhere/anytime in your application. loop do # Look for window with given title. Give up after 1 second. ret = autoit.WinWait('Destroy', '', 1) # # If window found, send appropriate keystroke (e.g. {enter}, {Y}, {N}). if (ret==1) then autoit.Send('{enter}') end # # Take a rest to avoid chewing up cycles and give another thread a go. # Then resume the loop. sleep(3) end end $popup = Thread.new { check_for_popups } # start popup handler at_exit { Thread.kill($popup) } After running i get the following error js_eval': missing ; before statement (JsshSocket::JSSyntaxError) from /var/lib/gems/1.8/gems/firewatir-1.6.7/lib/firewatir/jssh_socket.rb:27:in `js_eval_method' from /var/lib/gems/1.8/gems/firewatir-1.6.7/lib/firewatir/element.rb:936:in `enabled?' from /var/lib/gems/1.8/gems/firewatir-1.6.7/lib/firewatir/element.rb:922:in `assert_enabled' from /var/lib/gems/1.8/gems/firewatir-1.6.7/lib/firewatir/element.rb:1072:in `click' from user_destroy.rb:6 On Thu, Nov 18, 2010 at 2:36 PM, Željko Filipin zeljko.fili...@wa-research.ch wrote: On Thu, Nov 18, 2010 at 8:21 AM, Amit Kulkarni amitkkulkarni...@gmail.com wrote: On delete action popup is there which onclick it shows a pop up box along with two buttons i.e. Ok and Cancel Maybe something from here could help you: http://wiki.openqa.org/display/WTR/Pop+Ups http://wiki.openqa.org/display/WTR/JavaScript+Pop+Ups Željko -- watir.com - community manager watirpodcast.com - host testingpodcast.com - audio podcasts on software testing. all of them -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general
[wtr-general] Re: Option in select
I don't ever find myself using xpath, but you could look here: http://wiki.openqa.org/display/WTR/XPath Hope it helps. orde On Nov 24, 3:01 pm, Shlomit Gazit shlomitpatr...@gmail.com wrote: I am not sure I know how. could I get help on that? On Nov 24, 1:16 am, Željko Filipin zeljko.fili...@wa-research.ch wrote: On Tue, Nov 23, 2010 at 8:47 PM, Shlomit Gazit shlomitpatr...@gmail.com wrote: Is there an option to use title for option? This is the html code: option id=http://semanticweb.databaserepublic.com/c2p/systemData/ searchField#attachmentTargetItself value=341 title=true,Inner Search,^50$|^62$|^56$,attachmentTargetItselfAttachment::/option Did you try? Željko -- watir.com - community manager watirpodcast.com - host testingpodcast.com - audio podcasts on software testing. all of them -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com