[wtr-general] Re: [ruby watir cucumber] text assertions
Single = statement is assignment though ruby usually warns you. comparison is == On Thursday, October 18, 2012 5:27:33 PM UTC-5, Ry wrote: Is there a better way to write this? my goal to verifying text exists on the page and if it does to return to previous page otherwise close the window When /^I should be taken to the my text page$/ do if ie.text('Modification of awesome things').visible? = true then ie.back else ie.close end end my error when running this is syntax error, unexpected keyword_else, expecting $end else ie.close -- 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] Click on Hidden button
input type=submit value=Search id=searchsubmit name=submit class=submit That input button is hidden and I want to click it with script in WATIR. But it is said that cannot be accessed because it is hidden On Tuesday, August 28, 2012 8:25:12 PM UTC+7, Željko Filipin wrote: On Tue, Aug 28, 2012 at 12:11 PM, Kayen karthi...@gmail.com javascript: wrote: I am using Watir-Webdriver for my web automation and please could someone let me know whether its possible to click on a hidden button? What are you trying to do? Example HTML and Watir code would help. Željko -- filipin.eu -- 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] [ruby watir cucumber] text assertions
Yes... There are no menus or filters or drop downs on the page. My intent is clicking a link, taken to page, and checking some text on that page to ensure the link went to where I expected to go. The page in this case is a term of condition page which only has several paragraphs of text. I took a few words from the first line. I open to suggestions of a better to assert this page. Thanks all Ryan On Thursday, October 18, 2012 3:58:00 PM UTC-7, Oscar.Rieken wrote: Yes, first You are doing an assertion in a when (in cucumber when is more for changing state) Second by ie.text I assume you are checking all of the text of the page better to locate the exact text location Can you give us more info on what you want to do Sent from my iPhone On Oct 18, 2012, at 6:27 PM, Ry cross...@gmail.com javascript: wrote: Is there a better way to write this? my goal to verifying text exists on the page and if it does to return to previous page otherwise close the window When /^I should be taken to the my text page$/ do if ie.text('Modification of awesome things').visible? = true then ie.back else ie.close end end my error when running this is syntax error, unexpected keyword_else, expecting $end else ie.close -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-...@googlegroups.com javascript: http://groups.google.com/group/watir-general watir-genera...@googlegroups.com javascript: -- 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: Win32-process error Installation Watir 2.0.4
When you try to install watir 2.0.4, it will grab the latest version of the win32-process gem (and other dependencies) unless you already have one installed. Currently the win32-process gem is at version 0.7.0, which you do not want. So the solution is to manually install a prior version of the win32-process gem. I believe watir 2.0.4 was originally using win32-process 0.5.5, though I think you could use 0.6.6 as well. I was able to get Watir 2.0.4 to install successfully (ie could launch and close an IE browser) from a fresh Ruby 1.8.7 install by doing: gem install win32-process -v 0.5.5 gem install watir -v 2.0.4 - Justin On Thursday, October 18, 2012 9:55:08 AM UTC-4, Shryan wrote: So previously on my old machine I was using Ruby 1.8.7 in conjunction with Watir 2.0.4. I recently inherited a new system. I am trying to configure my same set up on this PC now. However, I install Ruby 1.8.7 and then try to install a specific version of Watir. watir -v 2.0.4 When I do this though it begins to install and then fails. It says that win32-process requires ruby 1.9.2. If I upgrade my Ruby library, there are a lot of process changes that have to take place in order to get he scripts functional again. (I have checked). Does anybody have a solution on how to get Ruby 1.8.7 with Watir 2.0.4 reinstalled. I am not sure why it was working on my other system and will not on this one. Thank you, any help is 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
Re: [wtr-general] Click on Hidden button
Hi, Can you paste the html with hidden button in here? Can a user click the hidden button? Joe On Aug 28, 2012 6:11 AM, Kayen karthigaya...@gmail.com wrote: Hi all, I am using Watir-Webdriver for my web automation and please could someone let me know whether its possible to click on a hidden button? If not, is there a work around for this? Many thanks, Kayen -- 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 -- 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: Having trouble accessing the download bar in IE 9.
Hi, The download bar in IE9 is a really strange thing - it is not anything you could automate with RAutomation or AutoIt easily. The easiest way you could do anything at all would be to change the default download directory for IE with win32-registry and then issue some commands like ctrl+s (not sure about this one) or send some tab and enter keystrokes. In short - really painful thing to do. Jarmo Pertman - IT does really matter - http://itreallymatters.net On Thursday, October 18, 2012 8:34:29 AM UTC+3, $uraj wrote: Hi, I am having trouble in accessing the new download bar at the bottom in IE 9. I am using watir 2.0.4..Is there a way available to access it. -- 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: Unable to select item from selectlist on watir-classic 3.2: SystemStackError: stack level too deep
But this error is not SystemStackError and might be something else. I'll investigate it, but would like to reproduce SystemStackError with minimal code sample. It would be awesome if you could reproduce that error too. Jarmo Pertman - IT does really matter - http://itreallymatters.net On Friday, October 19, 2012 12:29:47 AM UTC+3, Champ wrote: I removed the frame and created a simple html with a selectlist and saved it as sel.html *Html:* *htmltabletrtd* *SELECT size=1 name=filter OPTION selected value=OPTION value=YActiveOPTION value=NIn-Active/OPTION/SELECT* */td/tr/table/html* * * *Watir Code* *require 'watir'* *require 'watir-classic'* *browser=Watir::Browser.start file:///sel.html #Specify complete path* *browser.select_list.select(Active)* *Response*: *C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-classic-3.2.0/lib/watir-classic/element.rb:66:in `assert_exists': Unable to locate element, using {:tag_name=[select]} (Watir::Exception::UnknownObjectException)* * from C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-classic-3.2.0/lib/watir-classic/element.rb:418:in `perform_action'* * from C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-classic-3.2.0/lib/watir-classic/input_elements.rb:37:in `select'* * from sel.rb:4:in `main'* Note that the same html and the code worked fine on Ruby 1.8.7 and watir-2.0.4 On Thursday, October 18, 2012 2:54:26 PM UTC-4, Jarmo Pertman wrote: Your select is also inside of the frame. I don't see if Champ tried to run that code directly inside of the frame or not, but can you try if that makes any changes if you open the source of the frame in your browser and then manipulate select directly inside of your browser and not a frame? J. On Thursday, October 18, 2012 8:31:11 PM UTC+3, Drake wrote: Further information: If you go to the browser and manually select the value, then run the code, it returns a successful value. If the value selected manually is anything but the one you want in the code, it freezes and errors out. Champ's solution of changing the input_elements.rb file worked for me as well. On Thursday, 18 October 2012 12:35:45 UTC-4, Drake wrote: OK, so it looks like I'm having the same problem. Frame: id=mainControlFrame List in the frame: select size=4 name=provList id=provList onChange=onChange() ondblclick=onOkClick() option value=9Alberta/option option value=10British Columbia/option option value=7Manitoba/option option value=4New Brunswick/option option value=1Newfoundland/option option value=6Ontario/option /select There is an OK button below this in a table cell. watir code I'm using: provsel.frame(:id, mainControlFrame).select_list(:id, provList).select(New Brunswick) provsel.frame(:id, mainControlFrame).td(:text, OK).click_no_wait There is code prior to this that runs smooth, but as soon as it hits the select statement, the list box turns yellow, and nothing gets done. Eventually, if I leave it long enough, I get the same error: Stack level too deep. On Wednesday, 17 October 2012 20:58:46 UTC-4, Champ wrote: Ok. Here is the html for the select_list that was found. searching found: SELECT style=BACKGROUND-COLOR: yellow class=NORMDATA size=1 name=filter OPTION selected value=OPTION style=BACKGROUND-COLOR: yellow value=YActiveOPTION value=NIn-Active/OPTION/SELECT E === Error: test_01 SystemStackError: stack level too deep C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-classic-3.2.0/lib/watir-classic/locator.rb:129 === On Wednesday, October 17, 2012 4:04:34 PM UTC-4, Jarmo Pertman wrote: Replace the found like to this: puts found: #{found_select.html} Jarmo On Tuesday, October 16, 2012 7:49:11 PM UTC+3, Champ wrote: Jarmo, I tried with the code that you shared. The select_list does get identified but shows id: and not the element and I get the stack error message below. This might be the cause ** searching found: id: E === Error: test_01 SystemStackError: stack level too deep C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-classic-3.2.0/lib/watir-classic/locator.rb:129 On Tuesday, October 16, 2012 11:31:49 AM UTC-4, Jarmo Pertman wrote: That's just strange. I don't see any reasons why this code ought to go turn into stack overflow. However if you change the line to ole_object.focus then sometimes select list onChange event won't be triggered. It would be awesome if you'd figure it out what exactly goes into endless loop there and how to reproduce it. E.g. does the select_list itself get found in change_selected? You can find that out by changing
[wtr-general] Re: Unable to select item from selectlist on watir-classic 3.2: SystemStackError: stack level too deep
To reproduce the SystemStackError error, you can use the w3schools page: require 'watir-classic' browser = Watir::Browser.new browser.goto('http://www.w3schools.com/tags/tryit.asp?filename=tryhtml_select') browser.frame(:name, 'view').select_list.select('Saab') Or if you want to do it locally, you can create a page with an iframe and select list: main.htm: html body iframe name=view src=frame.htm /body /html frame.htm: html body select option value=volvoVolvo/option option value=saabSaab/option option value=opelOpel/option option value=audiAudi/option /select /body /html Note: The problem can be seen with iframes as well as framesets. Hope that helps. - Justin -- 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