[wtr-general] Re: Using Watir to Click a Button that has OnClick attribute
You should be able to use the fire_event method instead of the click method. A generic example: browser.button(:id = foo).fire_event(onclick) HIH. orde On Friday, September 7, 2012 11:05:55 AM UTC-7, Brickman wrote: Hello All, I have an issue configuring a script that will simply click on a button. Here is the HTML code input type=button value=Continue ... onClick=parent.location='DefaultOrig.asp' / I have been around the internet and looked at many forums to try different scripts, but nothing seems to work. To me it seems to be with the onClick attribute, and I not super well rounded in HTML however that appears to be a java script element. Any help is appreciated and if you need more code or information please let me know. -- 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: watir help
A couple of piggyback comments on the above. a) first question about accessing elements in a frame: browser.frame(:id, foo).link(:href = / productpref=catalog/).click# the example frame has no attributes, so I guess you could use index... b) lots of javascript in the second example, so you might need to trigger the event: browser.link(:id, foo).fire_event(onmouseover)# mouseover is an example event handler HIH. orde On Feb 1, 3:52 pm, Dave McNulla mcnu...@gmail.com wrote: For the first question, I would try these: browser.link(:href = /productpref=catalog/).click browser.link(:text = 'catalog').click For the second question, I would try these: browser.link(:text = 'Active').click browser.link(:href = /List Catalogs/).click Of course I wouldn't give up if those did not work, but I would try to following identification methods (probably in that order) OR a combination of them: :href :name :id :text :index :class :html :after :xpathhttp://wiki.openqa.org/display/WTR/HTML+Elements+Supported+by+Watir Dave -- 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: Export entire html table to a text document
Although it won't capture the HTML tags, you can dump the contents of a table like this: table_contents = browser.table(:id, 'foo').to_a For writing to .txt file, check out the ruby File class: http://www.ruby-doc.org/core-1.9.3/File.html This is an example for writing the HTML for a page to a file: browser.goto(test_site) html = browser.html f = File.new(txt.txt, w+) f.write(html) f.close Hope it helps. orde On Dec 2, 1:42 am, Mark Ballinger mark.j.ballin...@gmail.com wrote: Thank you for your reply. After re-reading what I have written and thinking about what I what to achieve... I don't believe I want to extract the table data into excel. I would like to extract it to a .txt (notepad document). The purpose of extracting the data is to check it against it against what I have in my database :-). If I can get it into .txt file (notepad document) I have the know-how to clean it and import it into sql for validation. FYI the data in the table looks like this... table border=1 cellpadding=2trth Address /thth Council tax band /thth Annual council tax /th/tr trtd 2, STONELEIGH AVENUE, COVENTRY, CV5 6BZ /tdtd align=center F /tdtd align=center pound;2125 /td/tr ... The above row is repeated many time .. /table Then the table is closed. So to re-cap my situation. I can use Watir to navigate the browser to the page containing the html table but my problem is that I am unsure of how to extract the results (everything within the table tag - including the html) to a .txt file and then save that .txt file onto my computer. I would prefer to take smaller steps with using Watir. I am knew to it therefore I would just like to learn how to extract the table and save everything that I have extracted into a .txt file. I have seen a couple of examples online using hpricot. However most of the examples seem to miss off code detailing how the array (if that is the correct approach) is outputted into a .txt file. Could you help by demonstrating how to write a simple piece of code which will extract the html table ( and everything, including the tr, td and everything in between) to a .txt notepad file? Many thanks for your time. On Dec 2, 2:36 am, bis bis...@gmail.com wrote: To me that sounds like a lot of extra work what happens once it is in an excel? Why would putting it in an excel be better than asserting it all within the test itself So I'll go ahead and ask some questions first. Will it happen more than once validating the excel? What sort of data is in the table? Would you be comparing the data in the excel vs data in a data base? If yes, why not let the test do it? Sent from my iPhone On Dec 1, 2011, at 4:43 PM, Mark Ballinger mark.j.ballin...@gmail.com wrote: Hi I am a newbie to groups and to ruby, watir, watir-webdriver etc... Basically all I would like to do is export a table from a web page which I have instructed the browser to find using Watir-webdriver. I just want to take the whole contents of the html table and place it into Excel for further analysis. I have the got the following code to work: require 'rubygems' require 'hpricot' require watir-webdriver url = http://www.mycounciltax.org.uk/results? postcode=cv35+8ausearch=Search browser = Watir::Browser.new browser.goto url All i would like to do now is save the table. How do save the html to a csv or .txt file into my C;\Temp folder? Best Regards, Mark -- Before posting, please readhttp://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: New member of the Watir team
+1 On Oct 26, 1:50 am, Dan Claudiu Pop danclaudiu...@gmail.com wrote: Hail to Chuck ! -- 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: retrieve drop list items/values
Something like this? options = browser.select_list(:id, foo).options com_list = String.new options.each do |option_text| com_list #{option_text}, end Hope it helps. orde On Oct 20, 10:28 am, Joe Fl joeflec...@gmail.com wrote: How can take those values from the list and put them in a string so I can use the split method? the values from the list box are ACG GI Circle Advisory Board CDK Sandbox Advisory Board Sandbox AFCC Akron Children's Hospital Bayer Pulmonary Hypertension Community Better Health Greater Cleveland Board of Governors Case Western Reserve University - School of Medicine Alumni CHB Demo Children's Hospital Boston Children's Hospital Boston Alumni Association Satellite Community Children's Hospital Boston PPOC Online Community Covance Virtual Advisory Board Future Forum Future Forum Editorial Board GI Consultant Forum Janssen Advisory Board Forum Medical Affairs Leaders Forum NAPH Member Community I want to place them in a string called com_list with a comma between each value. I currently retrieve them by above code but it would a lot easier to work with them in a string. Thank you, Joe On Oct 19, 3:17 pm, Chuck van der Linden sqa...@gmail.com wrote: On Oct 19, 11:14 am, Joe Fl joeflec...@gmail.com wrote: Hi, I have figure it out. Code... names = $browser.select_list(:name,'communities').options community_names_arr = Array.new commuName = name_number = 0 names.each do |name| puts commuName = #{name_number}: #{name.text} name_number = name_number + 1 end this gives me the text to each option in the listbox. You might want to make use of .each_with_index to make your code a little easier and cleaner names = $browser.select_list(:name,'communities').options community_names_arr = Array.new commuName = names.each_with_index do |name, i| puts commuName = #{i}: #{name.text} end -- 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: How to click on a div tag
I've seen this topic come up a few times in this forum (i.e. automating yahoo email or gmail), and I'd advise finding another option if possible. They have tons of dynamic content and change frequently, so it's a serious challenge to maintain. Sorry it's not the answer that you're looking for, but that's my 2 cents. HTH orde On Oct 13, 3:53 pm, iamqa srko...@gmail.com wrote: I am trying to automate some testing on yahoo email. I need to click on the subject or from, so that the email content opens up. I am able to select the first email by firing onmousedown but unable to go forward from there. This is my code: @browser.div(:id,shellcontent).div(:id,inboxcontainer).div(:id,msg- list).div(:class,list-view ).div(:class,list-view-items ).div(:class=list-view-item btn-msglist resize- columns, :index=1).div(:class,subj).fire_event('onmousedown') I tried firing onkeyup, onkeydown, onmouseup, onmousedown, onclick but nothing is working. I also tried send_keys({ENTER}) but was getting an error as: C:/Ruby187/lib/ruby/gems/1.8/gems/watir-1.8.1/lib/watir/element.rb: 378:in `method_missing': undefined method `send_keys' for #Watir::Div: 0x2b58d78 located=false how=:class what=subj (NoMethodError) from email_Agent_MonthlyNonMemberContent_Yahoo.rb:84 Thanks -- 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: Scroll DIV element in watir-webdriver
This works in watir 1.9.x: @browser.div(:id, foo).document.scrollintoview Hope it helps. orde On Sep 27, 8:10 am, the_zonker the.zonk...@gmail.com wrote: Hi guys, My SUT has a modal popup with dynamically loaded content. When user scrolls it down new records appear. DIV element of modal popup, which contains all records, has its own scroll bar. So my task is to scroll down DIV to the bottom, wait until all records are loaded and get them all. At present moment I cannot scroll down DIV. I tried to iteratively focus on records to get scrolling in DIV, but scrolling didn't happen and thereby no any records are loaded. Does watir-webdriver has native methods to scroll inside the element (not in browser window or frame)? I know that there are some solutions which use tricky Javascript but I'm trying to avoid it. I appreciate any help. Regards, Vadim -- 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: Can't access HTML in modal dialog using Ruby 1.9.2 and Watir 2.0.2
Does watir 2.x support ruby 1.9.x? http://watir.com/installation/ still recommends 1.8.6 or 1.8.7 (although the documentation might be slightly out of date). orde On Sep 16, 7:48 am, George Wiley george.wi...@gmail.com wrote: The code below works fine with Win7, IE8, Ruby 1.8.6 and Watir 1.6.2 for accessing an 'Internet Explorer_TridentDlgFrame' modal dialog. This code gives the error below when I upgrade to Ruby 1.9.2 and Watir 2.0.2. It does not appear to be a timing issue because I have tried sleeps and Watir::Wait.until without success. I can find the dialog but I cannot access the HTML code. I can also find the dialog using RAutomation directly but I have the same problem. I can't see the HTML to access the controls on the modal dialog. The modal dialog has a text_field a select_list and 2 buttons all within a frame. Is there another tool I should be using with these newer versions of Ruby and Watir to access the HTML in a modal dialog? Thank you for your help. * require 'watir' ie = Watir::IE.attach(:title, /my title/i) btnOK = ie.button(:id, 'OK').click_no_wait() # this opens the modal dialog iemod = nil 50.times do begin iemod = ie.modal_dialog # this does find the dialog puts ** dialog found ** break rescue puts ** dialog not found ** sleep(1) end end sleep(20) frame = iemod.frame(:name, 'Frame') modSelectList = frame.select_list(:name, 'Select_List') puts modSelectList.exists? C:/programs/Ruby-192-p290/lib/ruby/gems/1.9.1/gems/watir-2.0.2/lib/ watir/modal_dialog.rb:32:in `locate': undefined method `connect_unknown' for WIN32OLE:Class (NoMethodError) from C:/programs/Ruby-192-p290/lib/ruby/gems/1.9.1/gems/watir-2.0.2/ lib/watir/modal_dialog.rb:36:in `document' from C:/programs/Ruby-192-p290/lib/ruby/gems/1.9.1/gems/watir-2.0.2/ lib/watir/locator.rb:7:in `document' from C:/programs/Ruby-192-p290/lib/ruby/gems/1.9.1/gems/watir-2.0.2/ lib/watir/locator.rb:147:in `each_element' from C:/programs/Ruby-192-p290/lib/ruby/gems/1.9.1/gems/watir-2.0.2/ lib/watir/locator.rb:159:in `block in each' from C:/programs/Ruby-192-p290/lib/ruby/gems/1.9.1/gems/watir-2.0.2/ lib/watir/locator.rb:158:in `each' from C:/programs/Ruby-192-p290/lib/ruby/gems/1.9.1/gems/watir-2.0.2/ lib/watir/locator.rb:158:in `each' from C:/programs/Ruby-192-p290/lib/ruby/gems/1.9.1/gems/watir-2.0.2/ lib/watir/locator.rb:173:in `locate' from C:/programs/Ruby-192-p290/lib/ruby/gems/1.9.1/gems/watir-2.0.2/ lib/watir/frame.rb:10:in `locate' from C:/programs/Ruby-192-p290/lib/ruby/gems/1.9.1/gems/watir-2.0.2/ lib/watir/element.rb:75:in `assert_exists' from C:/programs/Ruby-192-p290/lib/ruby/gems/1.9.1/gems/watir-2.0.2/ lib/watir/frame.rb:35:in `document' from C:/programs/Ruby-192-p290/lib/ruby/gems/1.9.1/gems/watir-2.0.2/ lib/watir/frame.rb:24:in `__ole_inner_elements' from C:/programs/Ruby-192-p290/lib/ruby/gems/1.9.1/gems/watir-2.0.2/ lib/watir/locator.rb:200:in `each_element' from C:/programs/Ruby-192-p290/lib/ruby/gems/1.9.1/gems/watir-2.0.2/ lib/watir/locator.rb:220:in `each' from C:/programs/Ruby-192-p290/lib/ruby/gems/1.9.1/gems/watir-2.0.2/ lib/watir/locator.rb:213:in `locate' from C:/programs/Ruby-192-p290/lib/ruby/gems/1.9.1/gems/watir-2.0.2/ lib/watir/input_elements.rb:6:in `locate' from C:/programs/Ruby-192-p290/lib/ruby/gems/1.9.1/gems/watir-2.0.2/ lib/watir/element.rb:391:in `exists?' from watir202test.rb:39:in `main' ** dialog found ** -- 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: Can't access HTML in modal dialog using Ruby 1.9.2 and Watir 2.0.2
Ahhh...I didn't realize that Ruby 1.9.2 + Watir 2.x was ready for testing. I'll have to upgrade a VM and take a look as well. Sorry for getting off topic and not providing a solution to your issue ;) orde On Sep 16, 11:03 am, George Wiley george.wi...@gmail.com wrote: I read in this group that Ruby 1.9.2 and Watir 2.x was ready to test. I thought I would run my scripts through and see what I get. For the most part with some changes I have been able to run many scripts successfully. This happens to be a problem I can't figure out. On Sep 16, 12:47 pm, orde ohil...@gmail.com wrote: Does watir 2.x support ruby 1.9.x? http://watir.com/installation/ still recommends 1.8.6 or 1.8.7 (although the documentation might be slightly out of date). orde On Sep 16, 7:48 am, George Wiley george.wi...@gmail.com wrote: The code below works fine with Win7, IE8, Ruby 1.8.6 and Watir 1.6.2 for accessing an 'Internet Explorer_TridentDlgFrame' modal dialog. This code gives the error below when I upgrade to Ruby 1.9.2 and Watir 2.0.2. It does not appear to be a timing issue because I have tried sleeps and Watir::Wait.until without success. I can find the dialog but I cannot access the HTML code. I can also find the dialog using RAutomation directly but I have the same problem. I can't see the HTML to access the controls on the modal dialog. The modal dialog has a text_field a select_list and 2 buttons all within a frame. Is there another tool I should be using with these newer versions of Ruby and Watir to access the HTML in a modal dialog? Thank you for your help. * require 'watir' ie = Watir::IE.attach(:title, /my title/i) btnOK = ie.button(:id, 'OK').click_no_wait() # this opens the modal dialog iemod = nil 50.times do begin iemod = ie.modal_dialog # this does find the dialog puts ** dialog found ** break rescue puts ** dialog not found ** sleep(1) end end sleep(20) frame = iemod.frame(:name, 'Frame') modSelectList = frame.select_list(:name, 'Select_List') puts modSelectList.exists? C:/programs/Ruby-192-p290/lib/ruby/gems/1.9.1/gems/watir-2.0.2/lib/ watir/modal_dialog.rb:32:in `locate': undefined method `connect_unknown' for WIN32OLE:Class (NoMethodError) from C:/programs/Ruby-192-p290/lib/ruby/gems/1.9.1/gems/watir-2.0.2/ lib/watir/modal_dialog.rb:36:in `document' from C:/programs/Ruby-192-p290/lib/ruby/gems/1.9.1/gems/watir-2.0.2/ lib/watir/locator.rb:7:in `document' from C:/programs/Ruby-192-p290/lib/ruby/gems/1.9.1/gems/watir-2.0.2/ lib/watir/locator.rb:147:in `each_element' from C:/programs/Ruby-192-p290/lib/ruby/gems/1.9.1/gems/watir-2.0.2/ lib/watir/locator.rb:159:in `block in each' from C:/programs/Ruby-192-p290/lib/ruby/gems/1.9.1/gems/watir-2.0.2/ lib/watir/locator.rb:158:in `each' from C:/programs/Ruby-192-p290/lib/ruby/gems/1.9.1/gems/watir-2.0.2/ lib/watir/locator.rb:158:in `each' from C:/programs/Ruby-192-p290/lib/ruby/gems/1.9.1/gems/watir-2.0.2/ lib/watir/locator.rb:173:in `locate' from C:/programs/Ruby-192-p290/lib/ruby/gems/1.9.1/gems/watir-2.0.2/ lib/watir/frame.rb:10:in `locate' from C:/programs/Ruby-192-p290/lib/ruby/gems/1.9.1/gems/watir-2.0.2/ lib/watir/element.rb:75:in `assert_exists' from C:/programs/Ruby-192-p290/lib/ruby/gems/1.9.1/gems/watir-2.0.2/ lib/watir/frame.rb:35:in `document' from C:/programs/Ruby-192-p290/lib/ruby/gems/1.9.1/gems/watir-2.0.2/ lib/watir/frame.rb:24:in `__ole_inner_elements' from C:/programs/Ruby-192-p290/lib/ruby/gems/1.9.1/gems/watir-2.0.2/ lib/watir/locator.rb:200:in `each_element' from C:/programs/Ruby-192-p290/lib/ruby/gems/1.9.1/gems/watir-2.0.2/ lib/watir/locator.rb:220:in `each' from C:/programs/Ruby-192-p290/lib/ruby/gems/1.9.1/gems/watir-2.0.2/ lib/watir/locator.rb:213:in `locate' from C:/programs/Ruby-192-p290/lib/ruby/gems/1.9.1/gems/watir-2.0.2/ lib/watir/input_elements.rb:6:in `locate' from C:/programs/Ruby-192-p290/lib/ruby/gems/1.9.1/gems/watir-2.0.2/ lib/watir/element.rb:391:in `exists?' from watir202test.rb:39:in `main' ** dialog found **- Hide quoted text - - Show quoted text - -- 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: meaning of
I do not understand what role ! mark does in the code.. != is the negated form of the == operator. Take a look at Table 7.1 : Common comparison operators on http://phrogz.net/programmingruby/tut_expressions.html#expressions. orde On Aug 30, 12:54 pm, byung jinuacad...@gmail.com wrote: I come across below code.. while(ie.status! = Done) do sleep(1) end Can anybody tell me what the meaning of .. - ie.status! = Done - means?? I do not understand what role ! mark does in the code.. -- 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: Post form not on the page
Does this work (from http://rdoc.info/gems/watir/2.0.1/Watir/Form)? browser.form(:name, input).submit Hope it helps. orde On Aug 15, 7:48 am, Rahul Sharma rahulsharma@gmail.com wrote: Hi Dimitry, The reason I wanted to submit a local form is that I can not simulate user clicks as part of the tests. The form in the question is: htmlhead meta http-equiv=content-type content=text/html; charset=ISO-8859-1 /headbodyform name=input action= test-environment-url/promotion-code.promotion-codecheck method=post promotions code: input name=promotions_code value=PromotionName type= text input value=Submit type=submit /form /body/html Mind the formatting. This is the source of the form I want to post. For some reason I can not click on the Submit button to post it in the test. Is there another way? On 12 August 2011 21:20, Dmitriy Korobskiy dkro...@gmail.com wrote: On 8/6/11 1:33 PM, Rahul Sharma wrote: Thanks for the information there Dimitry and Chuck. I forgot to add one thing in my post. The form I am talking about is a form that has been created by a developer to assist automated testing. In real world, users of our website will see a promotion somewhere(let's say google). When one clicks on that advertisement it will bring the user to our website with the promotion code filled in and letting the users fill the rest of the form to be able to register and claim the promotion. So the form here is a HTML page written by a developer so that when I click on the button in the form it will do the same thing as in the real world when a customer clicks on a promotion on Google. I actually don;t have the HTML of the form handy but I can paste it on Monday when I get back to work. So basically my question was to whether I can define thatform /form in my Page and use it with the page object to post it and give me the website page filled with the promotion code just like the user would do actually. Rahul, Getting back to your original question of submitting a local form, why do you need to that? Do you really need to manipulate the form in a non-trivial way? If you don't, Watir can drive the browser to reproduce user clicks and filling the text on the form quite well without extra complications. -- DK AIM: DKroot1, Skype: DKroot -- Before posting, please readhttp://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/**group/watir-generalhttp://groups.google.com/group/watir-general watir-general+unsubscribe@**googlegroups.comwatir-general%2Bunsubscribe@go oglegroups.com -- Regards, Rahul Sharma Ph:+44 7800 736851 -- 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: how to select a month/day into that calendar http://calendarview.org/
The Today and arrow links are in cells. Have you tried to click the cell? For example: $browser.div(:id, mac).div(:class, calendar popup).cell(:text, Today).click Hope it helps... orde On Jul 19, 10:42 am, Cristina Dumitrescu cristina.watir.toro...@gmail.com wrote: I've attached the screen snapshot. On Tue, Jul 19, 2011 at 1:39 PM, Cristina Dumitrescu cristina.watir.toro...@gmail.com wrote: Hi, we are using that calendar component fromhttp://calendarview.org. When I click on a text field the popup calendar shows and I have to pick a date. I do now know how to select one month/day using watir. I attached a screensnapshot from our ui. And take a look at http://calendarview.org Example HTML Output We are using divs the calendar popup divs belong to the mac div I've try: $browser.div(:id, mac).div(:class, calendar popup) I do not know how to click on Today button/ click on the right arrow to jump to the next month and to select a day. Can one help me with that. Thanks a lot in advance, Cristina -- Cristina -- 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: how to select a month/day into that calendar http://calendarview.org/
Although I'm not using watir-webdriver, this works for me on http://calendarview.org (using ruby 1.8.6 + watir 1.9.0 + IE8): browser.div(:id, 'popupDateField').document.scrollintoview browser.div(:id, 'popupDateField').click puts browser.div(:class, calendar popup).cell(:text, Today).exists? if true # returns true I don't know why you're getting the undefined method error since the webdriver API contains a cell method. orde On Jul 19, 11:28 am, Cristina Dumitrescu cristina.watir.toro...@gmail.com wrote: c:/ruby187/lib/ruby/gems/gems/1.8/gems/watir-webdriver-0.2.4/lib/watir-webd river/elements/elements.rb 292: in method_missing: undefined method 'cell' for #Watir::Div Do I have any library missing? I was trying $browser.div(:id, mac).div(:class, calendar popup, :index =1}).cell(:text,Today).click But I am reciving an error also. Because there are so many divs I think that I have to specify one div by index?! On Tue, Jul 19, 2011 at 2:11 PM, orde ohil...@gmail.com wrote: The Today and arrow links are in cells. Have you tried to click the cell? For example: $browser.div(:id, mac).div(:class, calendar popup).cell(:text, Today).click Hope it helps... orde On Jul 19, 10:42 am, Cristina Dumitrescu cristina.watir.toro...@gmail.com wrote: I've attached the screen snapshot. On Tue, Jul 19, 2011 at 1:39 PM, Cristina Dumitrescu cristina.watir.toro...@gmail.com wrote: Hi, we are using that calendar component fromhttp://calendarview.org. When I click on a text field the popup calendar shows and I have to pick a date. I do now know how to select one month/day using watir. I attached a screensnapshot from our ui. And take a look at http://calendarview.org Example HTML Output We are using divs the calendar popup divs belong to the mac div I've try: $browser.div(:id, mac).div(:class, calendar popup) I do not know how to click on Today button/ click on the right arrow to jump to the next month and to select a day. Can one help me with that. Thanks a lot in advance, Cristina -- Cristina -- Before posting, please readhttp://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-general%0Awatir-general+unsubscr... -- Cristina -- 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: sending i18n data to remote computer using watir scripts.
I'm assuming no one answered because this isn't a watir-specific issue. I suggest a trying a Net::SSH on google or stackoverflow. Good luck. orde On Jul 8, 2:23 pm, Bhavesh bhavesh1_sha...@yahoo.com wrote: Di Anyone knows about it? On Jun 29, 3:56 pm, Bhavesh bhavesh1_sha...@yahoo.com wrote: Hi, I have routines to send commands to remote computer. def issueCommandInKazBox5(okMachine=, command=, matchLog=, user=admin, passwd=kazeon) puts issueCommandInKazMachine=#{okMachine} puts issueCommandInKazcommand=#{command} puts issueCommandInKazstatus=#{matchLog} puts issueCommandInKazuser=#{user} puts issueCommandInKazpasswd=#{passwd} Net::SSH.start(okMachine, user, :password = kazeon, :auth_methods = [password]) do |session| session.open_channel do |channel| channel.request_pty do |ch, success| raise Error requesting pty unless success ch.send_channel_request(shell) do |ch, success| raise Error opening shell unless success end end channel.on_data do |ch, data| STDOUT.print data end channel.on_extended_data do |ch, type, data| STDOUT.print Error: #{data}\n end channel.send_data #{command}\n.force_encoding('utf-8') channel.send_data exit\n session.loop end end end I fire commands like this to get the command fire on remote machine : issueCommandInKazBox($node1, add user bhavesh role admin, ) It works properly for english data. But when i have utf8 data, it throws error : issueCommandInKazBox($node1, add user âêžýáíúöóá¿ role admin, ) Error is : 1) Error: test_0001(TC_I18N): OpenSSL::Cipher::CipherError: data not multiple of block length C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/ transport/stat e.rb:85:in `final' C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/ transport/stat e.rb:85:in `final_cipher' C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/ transport/pack et_stream.rb:142:in `enqueue_packet' C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/ transport/sess ion.rb:223:in `enqueue_message' C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/ connection/ses sion.rb:368:in `send_message' C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/ connection/cha nnel.rb:493:in `enqueue_pending_output' C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/ connection/cha nnel.rb:312:in `process' C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/ connection/ses sion.rb:214:in `block in preprocess' C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/ connection/ses sion.rb:214:in `each' C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/ connection/ses sion.rb:214:in `preprocess' C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/ connection/ses sion.rb:197:in `process' C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/ connection/ses sion.rb:161:in `block in loop' C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/ connection/ses sion.rb:161:in `loop' C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/ connection/ses sion.rb:161:in `loop' C:/IE_AUTOMATION/kazeon/qa/watir-v1_4-TIP/Lib/KazeonCommon/ BasicMethodLibrar y.rb:2523:in `block (2 levels) in issueCommandInKazBox5' C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/ connection/cha nnel.rb:513:in `call' C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/ connection/cha nnel.rb:513:in `do_open_confirmation' C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/ connection/ses sion.rb:535:in `channel_open_confirmation' C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/ connection/ses sion.rb:456:in `dispatch_incoming_packets' C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/ connection/ses sion.rb:213:in `preprocess' C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/ connection/ses sion.rb:197:in `process' C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/ connection/ses sion.rb:161:in `block in loop' C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/ connection/ses sion.rb:161:in `loop' C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/ connection/ses sion.rb:161:in `loop' C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/ connection/ses sion.rb:110:in `close' C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh.rb: 191:in `sta rt' C:/IE_AUTOMATION/kazeon/qa/watir-v1_4-TIP/Lib/KazeonCommon/ BasicMethodLibrar y.rb:2500:in `issueCommandInKazBox5' C:/IE_AUTOMATION/kazeon/qa/watir-v1_4-TIP/KazModules/I18N
[wtr-general] Re: Report generation with the Watir
This thread should have useful information: http://stackoverflow.com/questions/5073552/rspec-ruby-basic-example-error Hope it helps. orde On Jun 28, 7:39 am, Parag Dave parag...@gmail.com wrote: Thanks Zeljko, This will really helpful. But i have some problem i am not able to understand how to run this test. I created one file named bowling_spec.rb # bowling_spec.rb require 'bowling' require 'rubygems' require 'rspec' describe Bowling, #score do it returns 0 for all gutter game do bowling = Bowling.new 20.times { bowling.hit(0) } bowling.score.should == 0 end end Run the script bowling_spec.rb in command prompt. and getting the error No such file or Directory -- bowling_spec.rb Load Error So what i am missing here (Sorry for the questions as i am new-bee to the testing with watir/rspec) I followed examplehttp://rspec.info/ I also followed thehttp://relishapp.com/rspecbut i am not able to generate the html report. Please guide me on that On Jun 28, 10:03 am, Željko Filipin zeljko.fili...@wa-research.ch wrote: On Tue, Jun 28, 2011 at 3:55 PM, Parag Dave parag...@gmail.com wrote: How can i generate report (That has visual identification like Fail test is in red line or any symbol and Pass test is in Green) with watir. Also how much time it took in the one test script. Is there any tool or gem that help to create logger report generation that might in XML or HTML. Sure, use RSpec gem: http://rspec.info/http://relishapp.com/rspec If possible please post the example code. or site that have example. This will create html file named report.htm: rspec file_name.rb --format html --out report.htm More information: http://relishapp.com/rspec/rspec-core/v/2-6/dir/command-line/format-o... Željko -- watir.com - community manager watir.com/book - author watirpodcast.com - host -- 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: How to get list content
This should point you in the right direction: http://rdoc.info/gems/watir/1.9.0/Watir/Container#lis-instance_method Hope it helps. orde On Jun 27, 9:13 am, Parag Dave parag...@gmail.com wrote: Hi All Geeks, Here i have some easy question ;) (That's why i am asking) $browser.table(:id, 'recent_records').to_a returns the number of row in the table, but if i want to count the number of list ul li id=32 li id=33 li id=34 li id=35 ul Here the value of the li is change as per the search term (Search returns the number of the list depend upon the search term). So question how can i check the number of return li I can not check with ID as it changes every time (As per the search term) -- 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: set (variable) issue
Are you converting the amount var into a string before passing it to the .set method? orde On Jun 22, 7:45 am, JohnH ictodo...@gmail.com wrote: I'm reading an integer value from an xls. file and save it in a variable called amount. Afterwards, I'm trying to send that variable value into a text field from a website, but I'm having some problems there. Here is the code: begin sleep 1 counter = counter + 1 browser.text_field(:name, name).set(amount) rescue if counter 10 retry end end If I use a direct value (like 5) instead or the amount variable it all works fine, but when trying in this form the form where the text field starts to change its position in the page :O I've tried as well with .value(variable) instead of .set(variable) but in this case nothing happens - the value is not sent. -- 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: how to read the object
Flash isn't supported in watir. There is/was a flashwatir fork, but I'm not sure if it's maintained anymore. On Jun 17, 12:05 am, Jasmine nicely...@hotmail.com wrote: I just start learning the watir,I have a problem about it in the project.Watir doesn't support the tag of the object,so how to read the element,following is html code. object width=80 height=30 type=application/x-shockwave-flash data=/mosicn/script/swf/uploadify.swf id=uploadifyUploader style=visibility: visible -- 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: Need to access the login window
This is more of a ruby question than a watir question. I'd suggest reading up on common control structures. There is good documentation at http://www.ruby-lang.org/en/documentation/ or (specific to your question) http://www.howtogeek.com/howto/programming/ruby/ruby-if-else-if-command-syntax/ On Jun 16, 8:51 am, era gupta era.gupt...@gmail.com wrote: This is what I want to know, How to use an If statement in this condition. On Thu, Jun 16, 2011 at 7:42 PM, Rahul Sharma rahulsharma@gmail.comwrote: After you have logged in you need to do a check if login is prompted again...use an if statement or something On Jun 16, 2:13 pm, era gupta era.gupt...@gmail.com wrote: Thanks Chuck for your response. Find below the code that I am trying to access: require 'watir' Watir::Browser.default = 'firefox' b = Watir::Browser.new b.goto site-url b.link(:href, Link to access).click b.text_field(:id, email_id).set(ad...@test.com) b.text_field(:name, pass).set(test) b.link(:text, Login).click In the above code line no. 6,7 and 8 I want to call when the site asks for the login again. Otherwise it should go to some other task. Any Idea how it can be done. On Thu, Jun 16, 2011 at 2:32 AM, Chuck van der Linden sqa...@gmail.com wrote: On Jun 15, 5:12 am, Era era.gupt...@gmail.com wrote: Hi, I am new in watir group and not very good in watir scripting. Please help me to write the script for the following scenario: There is one web application in which the user can access the main elements by logging into the account. But there is some issue in the login window. It sometimes asks to login twice it means the user has to give the username and password and then click on login button, then again enter the same username and password and click on login window. We're here to help, buy there is a limit, writing all the code for you is past the limit. What you can expect is responses in the area of helping when/where you get stuck, and helping you refine your approach, or suggesting other things to try instead. With that in mind, please respond as best you can tot he following: Does your system always do this, or is there some random element which controls when someone is asked for their credentials a second time? Is there an easy way to tell (such as perhaps the page title) if the user is still faced with a request for credentials verses logged into the system? Is the page source the same on both pages that request credentials? Can you provide please a sample of the page's HTML and also most important of all, the applicable Watir automation code you have tried so far? -- Before posting, please readhttp://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 http://groups.google.com/group/watir-general%0Awatir-general+unsubscr... -- Before posting, please readhttp://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-general%0Awatir-general+unsubscr... -- 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: Need to click on a link which has only the class name.
I'd agree with the post above. Unless you have some other compelling reason, the approach above should be fine. In any event, $1 is returning nil in this code snippet: if /LI class=.*id=mainTabsId__CaseDetailsA class=(\S*) onclick=.*/ begin ie.link(:class, $1).click rescue = e rescueHandle(e) end else puts $1 # nil puts FAILED! Could not find Class for Close Button return false end On Jun 15, 12:30 pm, Chuck van der Linden sqa...@gmail.com wrote: On Jun 15, 12:27 am, Mahesh mahesh...@gmail.com wrote: Hi, LI class=x-tab-strip-closable x-tab-with-icon x-tab-strip-active id=mainTabsId__CaseDetailsA class=x-tab-strip-close onclick=return false;/A This is the source code, and i am using the if condition to extract the dynamic class name to extract the class name click the link. The Watir script i am using is: if /LI class=.*id=mainTabsId__CaseDetailsA class=(\S*) onclick=.*/ begin ie.link(:class, $1).click rescue = e rescueHandle(e) end else puts FAILED! Could not find Class for Close Button return false end You say you are dynamically extracting the class of the link, does this mean it is changing in a regular basis? I'm having a hard time following exactly what your challenge is here, What do you know, e.g. what is constant each time or predictable each time? how do you know you've found the link you want to click? If the pattern is for example a list item with a particular ID, that contains the link you want, and the class of the link always contains the text ...strip-close then you could do something like this if browser.li(:id, mainTabsId__CaseDetails').link(:class, /strip- close/).exists? browser.li(:id, mainTabsId__CaseDetails').link(:class, /strip- close/).click else puts FAILED! Could not find Close Button return false end -- 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: watir scripts in windows scheduled task
I've used windows scheduler without any major hiccups. There is a thread in this forum that discusses scheduled watir scripts hanging on .js popups: http://groups.google.com/group/watir-general/browse_thread/thread/bde0ab5ef96408c2/d89d4ec8a790bc5a?lnk=gstq=windows+scheduler#d89d4ec8a790bc5a If the failing task deals with .js popups and the passing task doesn't, that might be something to look at. HTH orde On Jun 14, 7:00 am, chachster chachi.rich...@gmail.com wrote: Hi, I've heard that running watir scripts via the windows scheduled task might not be supported and generally doesn't work too well? If so, is there a workaround for this (ie: stopping the machine from getting locked, etc...). I'm currently using Watir 1.8,1 and Ruby 1.8.7 and have 2 scheduled tasks running watir scripts, one seems to work fine but one seems to be very sporadic and not reliable. Cheers! -- 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: How to deal with HTTP responce
This is more of a ruby question than watir question, but you can take a look at the Net:HTTP class: http://ruby-doc.org/stdlib/libdoc/net/http/rdoc/classes/Net/HTTP.html orde On May 16, 5:53 am, Сергей Демьянчук sergeydemjanc...@gmail.com wrote: Hi, Amit This is possible with Watir if you use HttpWatch Controller. Before tell you more i think it will be optional for you to take a look athttp://www.httpwatch.com/rubywatir/. The main idea of this approach is that you create the instance of the browser (Internet Explorer or Firefox) attach HttpWatch plugin and start to record. This plugin allows you to get information you are interested in (status codes, kbytes received, kbytes send, header info, etc). Thanks, Sergii 2011/5/16 Amit Bobade amit.sr...@gmail.com Dear all: I am trying to deal with http response using watir. It is possible with watir? If yes, please tell me how to deal with response (status code), header, etc. -- Thanks and Regards, Amit -- Before posting, please readhttp://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: Handling pop up
check out http://wiki.openqa.org/display/WTR/Pop+Ups Hope it helps. orde On May 11, 7:16 am, Vikas Garg vikas22...@gmail.com wrote: Hello, while writing script for my website on IE, I am getting some problem: While logging in my website on Internet Explorer, I am getting a pop-up message which is asking me for remembering the password. How can I handle that pop-up? -- 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: Printing a Text on Browser
puts browser.div(:class, system).text will print 123456 To see all tables on a page, use the show_tables method: http://rdoc.info/gems/watir/1.8.1/Watir/IE#show_tables-instance_method Hope it helps. orde On May 5, 3:14 am, Ashu ashay.n...@gmail.com wrote: Is there an alternative wherein I can list all the tables and then locate the particular desired text? Thanks... On May 5, 1:48 pm, Ashu ashay.n...@gmail.com wrote: Well I tried it, but since there doesnt exist any cell in the HTML, hence it does return with a error. On May 5, 12:54 pm, Željko Filipin zeljko.fili...@wa-research.ch wrote: On Thu, May 5, 2011 at 9:40 AM, Ashu ashay.n...@gmail.com wrote: on trying the above I get the following error :undefined method 'td' for #FireWatir::Firefox:ox:0x32de718 url= title=company:networknomethoderror Try this then: puts browser.cell(:id = e0_id).text Ž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
[wtr-general] Re: Moving a window
I use scrollintoview on IE7/8 + WinXP/7 without any errors (usually on div tags to reorient the page above the fold). Example: browser.div(how, what).document.scrollintoview orde On Apr 21, 8:24 am, Abe Heward abe.hew...@gmail.com wrote: My code: $ff.checkbox(:id, stdOptOut).document.scrollIntoView Error result: test.rb:7:in `main': undefined method `scrollIntoView' for :String (NoMethodError) -- 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: Sending single key presses to element.
You should able to accomplish it through either .fire_event or .send_keys methods. Examples: fire_event: http://rdoc.info/gems/watir/1.8.1/Watir/Element#fire_event-instance_method send_keys: http://rdoc.info/gems/watir/1.8.1/Watir/IE#send_keys-instance_method But I think that send_keys only works with IE. Hope it helps. orde On Apr 21, 2:55 am, Alastair Montgomery doodl...@gmail.com wrote: Having talked with our developers we would only need to be able to fire the following events; keydown, keyup, mousedown, mouseup and paste. So really need a way of being able to pass a key code with the keydown and keyup events for WATIR and FIREWATIR? -- 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: how to simulate Enter on a jumper box
If I'm following your question correctly, you can activate the Enter key via the send_keys method. For example: browser.send_keys('{ENTER}') For more info, see http://wtr.rubyforge.org/rdoc/1.6.5/classes/Watir/IE.html#M000497 Hope it helps. orde On Apr 13, 1:01 pm, a b cristina.watir.toro...@gmail.com wrote: I have attached the code screen snapshot. Thanks, Cristina On Wed, Apr 13, 2011 at 3:17 PM, a b cristina.watir.toro...@gmail.comwrote: Hi all, I didn't find any example on how to simulate Enter on a jump field. I have a jump/search text field and is working only when we hit enter. I do not have any other button.. I do not know how to do it on watir. I searched on watir group/ stackoverflow and google it but I didn't find anything to help me. Please let me know if I can find any example or any information. Hope One encountered that issue. Regards, Cristina -- 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: Watir 1.8.1.rc1 Released
FYI: I upgraded a couple of VMs (one XP; one Win7; both running IE8.x) to 1.8.1.rc1 and ran a subset of existing scripts without any issues. On Apr 8, 8:07 am, Charley Baker charley.ba...@gmail.com wrote: My guess is that there's some javascript event on your select list that's not getting fired to open the new window since you mention this happens with regular select as well as select_no_wait. Can you take a look at what's currently being fired on the select list? Cheers, Charley Baker Lead Developer, Watir,http://watir.com On Fri, Apr 8, 2011 at 7:20 AM, GJHmf graham.harb...@webroster.net wrote: I replied to this directly to Ivan in more detail, as he added the improvement. To everyone else; I don't want this thread to go off- topic, but for the record I got the same problem with select and select_no_wait. GJHmf -- Before posting, please readhttp://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: How to Trace the change in a field
Find a way to determine the value of div class=system and assign it to a variable. On Mar 3, 1:35 am, Ashu ashay.n...@gmail.com wrote: The xpath for the html html trtd class=normalcounter change/tdtd class=normaldiv class=system1/div/td/tr is xpath /html/body/div/div/div[4]/div/fieldset/table[3]/tbody/tr[9]/ td[2]/div On Mar 3, 2:17 pm, Ashu ashay.n...@gmail.com wrote: hi, there is a field on the php page that keeps track of the change in counter field. On every next refresh the value changes of that variable. trtd class=normalChange counter/td td class=normaldiv class=system1/div/td/tr The 1 in the above code determines that one transaction has taken place and it continues to increase up on every transaction update. I am unable to figure out the logic to keep track of the change. -- 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: Is there a 1.8.0 equivalent of Watir::Waiter.wait_until?
I'm using watir 1.7.1, but there are 2 files named wait.rb and element_extensions.rb (in *\commonwatir-1.7.1\lib\watir), which contain the Wait and ElementExtensions modules. These modules contain the method(s) that you want (i.e. the .until method). orde On Mar 2, 12:05 pm, chsonnu chso...@gmail.com wrote: Using Watir::Waiter.wait_until in 1.8.0 causes this message to display: Using Watir::Waiter is DEPRECATED and will be removed in some newer version of Watir! Use Watir::Wait and Watir::ElementExtensions methods instead! I'm assuming the message isn't valid since Watir::Wait and Watir::ElementExtensions no longer exist. What should we be using instead? -- 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: Automating the object with in TD tag
I'm not sure what your question is? +1. td tags can be accessed via the .cell method: http://wtr.rubyforge.org/rdoc/1.6.5/classes/Watir/Container.html#M000298 orde On Jan 12, 9:24 am, Basim Baassiri ba...@baassiri.ca wrote: I'm not sure what your question is? On Wed, Jan 12, 2011 at 10:28 AM, Sanu ure...@gmail.com wrote: Hi, I have an object with TD tag with out any object type specified. That is actually a tag in the application. please find the HTML code below TR TD class=styleTabUnSelected id=S3Role #text SCRIPT and goes like this if i spy the tab i am getting the below Attributs, Name Value align left background-image(css) url(../images/AsTabBackMiddle.gif) class styleTabUnSelected= color(css) #00 cursor(css) pointer height 24 id S3Role onclick JavaScript:pushTab('S3Role'); onmouseout JavaScript:mouseOutTab('S3Role') onmouseover JavaScript:mouseOverTab('S3Role') style BACKGROUND-IMAGE: url(../images/ AsTabBackMiddle.gif); CURSOR: pointer; COLOR: #00 I am very new to Ruby kindly provide your ideas. -- Before posting, please readhttp://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-general%0Awatir-general+unsubscr... -- 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: Timeout when setting a text_field
Try 'speed=:fast'. For example: browser = Watir::IE.new browser.speed=:fast It's documented at http://wtr.rubyforge.org/rdoc/1.6.5/classes/Watir/IE.html#M000470 Hope it helps. orde On Jan 4, 1:12 pm, Emmanuel Cecchet cecc...@gmail.com wrote: No, this is the set() operation that generates a timeout (Watir starts writing in the form but it takes a long time and the operation generates a timeout in the ruby script). I have no timeout on the server side. I forgot to mention that I am using Watir on Webdriver. So this might be a timeout coming from Webdriver. Emmanuel On 1/4/2011 4:08 PM, jv-watir wrote: If I understand correctly, it is a session time out, you may want to change in the web server settings or ask some one too, if it is the issue. On Jan 4, 3:45 pm, manucecc...@gmail.com wrote: Hi all, I am writing a pretty big chunk of text in a form and want to keep the default typing speed in the form to emulate a real user. So when I call: browser.text_field(:name, 'field').set('some very long text here') The operation stops before completion with a timeout. Is there a way I can override the timeout in the set operation so that it can complete? Any other workaround you can suggest? Thanks manu -- 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: Can't click on a nameless div
If browser.link(:text,Add Another State).click does't work, try browser.link(:text, /Add Another State/).click. If neither of those work, you may need to use the fire_event method (see http://wtr.rubyforge.org/rdoc/1.6.5/classes/Watir/Element.html#M000557). Example: browser.link(:text, /Add Another State/).fire_event(onclick) Hope it helps. orde On Dec 7, 2:21 pm, LizLeong elc.le...@gmail.com wrote: I'm running Ruby1.8.7 patchlevel 249 with Watir 1.6.7 on WinXP. I'm trying to click on the text Add Another State on a web page. It looks like a link, but I am having trouble hooking onto it. The structure is: div class=mainModule form name=stateBar id=stateBar action=http://www.website.com/ insert method=post div span id=writeBar/ div style=text-align: right; width a onclick=addState(3); $('a[id ^=dellink]'.show(); return false; href=# Text - Add Another State Text - Empty Text Node I've tried the following unsuccessfully. I tried to use flash also and didn't see anything highlighted either. ie.div(:class=mainModule).div(:text=Add Another State).click ie.div(:class=mainModule).div(:href=#).click ie.span(:text,Add Another State).link(:text,Add Another State).click Maybe there's no way to do what I want, even knowing that would help! -- 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: 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
[wtr-general] Re: Option in select
Not according to http://wiki.openqa.org/display/WTR/HTML+Elements+Supported+by+Watir. Check out the select_list method, and there's a red X for :title attribute. orde On Nov 23, 11:47 am, 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 -- 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: Need help to capture a string from the action attribute
You should be able to capture the action attribute like this: action_attribute = @browser.form(:name, mainForm).action Hope it helps. orde On Nov 15, 8:20 am, Shiv tms...@gmail.com wrote: Hello, This is my html: form name=mainForm action=/sma/operator/pmanager/pmotion/add.do method=post old_onsubmit=null _sfm_form_name=mainForm show_errors_together=true I am using rasta and watir for data driven testing. I want to capture this url in the above html and compare with the url which I get from excel using Rasta to pass my test. *Problem I am facing is * I want the action variable in the below watir code to store the string using the action attribute in form element, I have tried with different combinations but was unsuccessful This is my watir code: def error? trigger_link action = @@ie.form(:xpath, //fo...@action']) if (@page_name == action) puts #...@page_name} page is available return 0 else puts #...@page_name} page is not available return 1 end end def trigger_link @@ie.link(:text, @link_name).click end I want the action variable to store the string using the action attribute in form element, I have tried with different combinations but was unsuccessful any help is greatly appreciated Regards, Shiv -- 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: Capture Text
Try: puts @browser.cell(:class, pageContent).text Hope it helps. orde On Nov 5, 2:46 pm, Basim Baassiri ba...@baassiri.ca wrote: What code have you tried? You could use Xpath to retrieve the value looking at the class (if its unique to the page)http://wiki.openqa.org/display/WTR/XPath Try reading about tableshttp://rdoc.info/gems/watir/1.6.6/Watir/Table On Fri, Nov 5, 2010 at 5:32 PM, Eric Mathiesen mathiese...@gmail.comwrote: Hello All! I am running into a significant challenge capturing a string of text to later use in my script. Here's the situation. I have a basic create user form in my application (First Name, Last Name, Username) that provides a password on the page. How would I go about capturing the string for the password as It changes every time. In the snippet below, the string I want captured is ynHZaBK Any help is GREATLY appreciated! Viewing source gives me this (condensed to the fields I'm working with). tr align=left valign=middle td width =50% height =20 table width=100% border=0 cellpadding=0 cellspacing=0 tr class=formHeaderSkinBG td width=50% height= table width=100% border=0 cellpadding=0 cellspacing=1 tr class =formHeaderBG td width =50% height =20 class =formHeader id='3081488100560284032' onclick = root.handleOnClick(document, this); Password: nbsp; nobr /td /tr /table /td /tr /table /td td class=pageContent width= align=left valign=middle height=20 ynHZaBK /td /tr Thanks, Eric -- Before posting, please readhttp://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...@goog legroups.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: clicking a certain radio button with a specific value
This page lists the supported attributes for each HTML element: http://wiki.openqa.org/display/WTR/HTML+Elements+Supported+by+Watir You should be able to do the following: browser.radio(:value, 4).click Hope it helps. orde On Aug 25, 5:09 pm, lawcab law...@gmail.com wrote: Hi, need help. My page have 4 radio buttons. Same Name but different value. How can I say to select radio button that is value=4 input type=radio name=processoption66939274 value=1 input type=radio name=processoption66939274 value=2 input type=radio name=processoption66939274 value=3 input type=radio name=processoption66939274 value=4 Thanks, Law -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
[wtr-general] Re: How to verify a result in a pop-up message dialog?
Check out: http://wiki.openqa.org/display/WTR/Pop+Ups Hope it helps. orde On Aug 17, 7:33 am, Chan Nguyen atbl1...@gmail.com wrote: Hi Charley, Thanks for your response, however I think it's too general for a newbie for me. By mailing list, did you mean searching in this 'watir' group? Sorry, I haven't done anything like this before. How do we know which type of dialog box was popped up? Looking at the HTML source? Can you give me simple example? Thanks, On Aug 13, 1:04 pm, Charley Baker charley.ba...@gmail.com wrote: Check in the mailing list and the main watir site for the same. First identify what kind of dialog box you have and then work from there. hth, Charley Baker Lead Developer, Watir,http://watir.com On Fri, Aug 13, 2010 at 1:49 PM, Chan Nguyen atbl1...@gmail.com wrote: Hi Kevy, Is there any other way to work around this problem without touching AutoIt? On Aug 13, 12:16 pm, Super Kevy kpe...@scholarshipamerica.org wrote: You may consider the AutoIT extension for reading the content of the popup window On Aug 13, 11:06 am, Chan Nguyen atbl1...@gmail.com wrote: Hi Arihan, It is a Windows PopUp. When I manually run it, I use FF to locate the text inside that Windows; however, when I check w/ contains_text( Some Search Results ), it failed :( . Can you show me how to handle this situation? Thanks, On Aug 13, 9:03 am, arihan sinha arihan.si...@gmail.com wrote: is this a browser popup or window popup. if its browser pop up then its straight forward but if its window popup then you have to handle it differently Cheers A On Fri, Aug 13, 2010 at 4:45 PM, Chan Nguyen atbl1...@gmail.com wrote: Hi everyone, My situation is that I fill in a form then click search button. The result box will pop up with number of searches found. I want to verify the result in this textbox but I really have no idea how? Anyone could share me a hint? Thanks, -- Before posting, please readhttp://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@goog legroups.com watir-general%2bunsubscr...@googlegroups.com- Hide quoted text - - Show quoted text - -- Before posting, please readhttp://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@goog legroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
[wtr-general] Re: How to verify the browser contains text in another page?
For info on attaching, see http://wiki.openqa.org/display/WTR/Pop+Ups If you're trying to verify the existence of something in an iframe, you'll need to specify the frame. Example: browser.frame(id, 'id').whatever(:id, 'id').exists? On Aug 13, 9:16 am, Chan Nguyen atbl1...@gmail.com wrote: Hi orde again, I tried to use your second method. Unfortunately, I always got not exists when I tested the link a href=javascript:\\ onclick=window.open('http:// media.rapmlsstg.com/help/10.01.01/', 'newWin', 'menubar=yes,toolbar=yes,resizable=yes,directories=no,scrollbars=yes,status =yes'); return false; class=ImageLink id=Module_3__ctl1__ctl0_hprOnlineHelpimg border=0 align=absmiddle style=margin-right: 5px; src=http:// media.rapmlsstg.com/rapmlsimages/onlinehelp.gif id=Module_3__ctl1__ctl0_imgOnlineHelpOnline Help/a The code that I use : # Since it's nested in a frame 1. main_frame.link( :id, Module_3__ctl1__ctl0_hprOnlineHelp ).click # Check the link to see if it exists? if browser.link( :id, Module_3__ctl1__ctl0_hprOnlineHelp ).exists? or if browser.link( :href, http://media.rapmlsstg.com/help/ 10.01.01/ ).exists? For your first solution, I'm a little vague about assuming you've attached to the new page ? How can I do this? Thanks, On Aug 12, 2:09 pm, Chan Nguyen atbl1...@gmail.com wrote: Hi orde again, thanks a lot for your super sweet and quick response ^_^ ! KISS ! On Aug 12, 2:03 pm, orde ohil...@gmail.com wrote: 1. Verify text in a new opened page? browser.text.include?(string_to_verify) # assuming you've attached to the new page 2. Verify some condition in current page? Just an example: browser.link(:id, 'id').exists? And you would probably want to put that into a begin/rescue/end statement to handle a failure case gracefully: begin # assert/verify something (e.g. browser.text.include? (string_to_verify)) rescue # log the failure if it fails. end For some info on exception handling, check outhttp://ruby-doc.org/docs/ProgrammingRuby/html/tut_exceptions.html(or your favorite .rb reference doc). Hope it helps. orde On Aug 12, 1:22 pm, Chan Nguyen atbl1...@gmail.com wrote: Hi everyone, I encountered a problem that when clicking on a link, it will open a separate page. In other words, I will have 2 pages, so if I want to verify the web is doing correctly? What should I do? 1. Verify text in a new opened page? 2. Verify some condition in current page? For both 1 2, I don't really know how to start? Can anyone share me an example? Thanks, -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
[wtr-general] Re: Problem finding a way to access a link
If at all possible, try to get a developer to add an id tag (or some unique element attribute like name or value) to the href so that you can locate it more easily. Otherwise, you could try something like this: $browser.link(:href, /some_unique_part_of_href/).click or $browser.link(:href, /some_unique_part_of_href/).fire_event('onclick') Hope it helps. orde On Aug 12, 11:14 am, Melissa meisa...@gmail.com wrote: I'm trying to get my Watir test to click the link below, and I'm coming up empty. I've tried accessing it by text, href, title, cell, table, link index and anything else I could think of. It's such messy code - I'm starting to wonder if it's even possible to get at it. Any thoughts on what I can use to click the link? Thanks for any tips! td nowrap title=Business Objects To Query width=100 height=20 bgcolor=#efefe7 align=center style=font-size:90%;border- right:#94a6ce 1px solid;padding-right:4px;border-top:#94a6ce 1px solid;padding-left:4px;border-left:#94a6ce 1px solid;width: 100px;color:black;border-bottom:#FF9900 1px solid;font- family:tahoma;height:20px;background-color:#efefe7;text- align:center;text-decoration:none;font face=tahoma color=black a href=javascript:document.aspnetForm.__ctl00_TemplateBody_DesignShell1_ctl0 0_ctl00_SectionTabStrip_State__.value='1';__doPostBack('ctl00$TemplateBody $DesignShell1$ctl00$ctl00$SectionTabStrip','1') font color=blackSources/font/a/font /td -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
[wtr-general] Re: How to access a href link which is a java script?
Try: ie.link(:class, sWhiteLink).fire_event('onclick') For reference: http://wtr.rubyforge.org/rdoc/1.6.5/classes/Watir/Element.html#M000557 Hope it helps. orde On Aug 12, 1:43 pm, Chan Nguyen atbl1...@gmail.com wrote: Hi, I used Firebug to locate the element, it's a text link. And here is element's HTML: a onclick=parent.document.getElementById('Main_Body').src = 'customizehomepage.aspx?hidMLS=BARI';return false; href=javascript: \; class=sWhiteLinkCustomize Home Page/a I tried : ie.link( :class, sWhiteLink ).click but Watir does not regconize it? Any idea? Thanks, -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
[wtr-general] Re: How to verify the browser contains text in another page?
1. Verify text in a new opened page? browser.text.include?(string_to_verify) # assuming you've attached to the new page 2. Verify some condition in current page? Just an example: browser.link(:id, 'id').exists? And you would probably want to put that into a begin/rescue/end statement to handle a failure case gracefully: begin # assert/verify something (e.g. browser.text.include? (string_to_verify)) rescue # log the failure if it fails. end For some info on exception handling, check out http://ruby-doc.org/docs/ProgrammingRuby/html/tut_exceptions.html (or your favorite .rb reference doc). Hope it helps. orde On Aug 12, 1:22 pm, Chan Nguyen atbl1...@gmail.com wrote: Hi everyone, I encountered a problem that when clicking on a link, it will open a separate page. In other words, I will have 2 pages, so if I want to verify the web is doing correctly? What should I do? 1. Verify text in a new opened page? 2. Verify some condition in current page? For both 1 2, I don't really know how to start? Can anyone share me an example? Thanks, -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
[wtr-general] Re: Understanding Modules and Classes a little better
An old version of Programming Ruby is online: http://ruby-doc.org/docs/ProgrammingRuby/ Classes: http://ruby-doc.org/docs/ProgrammingRuby/html/tut_classes.html Modules: http://ruby-doc.org/docs/ProgrammingRuby/html/tut_modules.html It's the 1.6 version of Ruby, but the concepts are the same. Hope it helps. orde On Jul 28, 2:08 am, Željko Filipin zeljko.fili...@wa-research.ch wrote: On Tue, Jul 27, 2010 at 10:48 PM, Jason freezingki...@gmail.com wrote: I might post a few discussions here over the coming days trying to better improve my framework, You could also take a look at existing Watir frameworks: http://github.com/scudco/tazahttp://github.com/bret/watircrafthttp://tech.groups.yahoo.com/group/watir-framework/ Željko -- watir.com - community manager watirpodcast.com - host testingpodcast.com - audio podcasts on software testing. all of them vidipodkast.com - pričamo o hardveru, softveru i časopisu Vidi -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
[wtr-general] Re: Vista IE8... does not wait for
I don't run Vista, but I do recall some need to run as administrator on Vista threads. You can search this forum and/or this FAQ blurb might help: http://wiki.openqa.org/display/WTR/FAQ#FAQ-WhatshouldIdoiftwobrowserwindowsappearwhenrunningatestunderWindowsVista%3F orde On Jul 28, 1:59 pm, niartseoj niarts...@gmail.com wrote: when i run these commands in IRB the ie.text_field(:name, 'UserName').flash works and ie.text_field(:name, 'UserName').set('user') works but i'm getting this when try to run it in a file c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:56:in `assert_exists': Unable to locate element, using :name, UserName (Watir::Exception::UnknownObjectException) from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb: 288:in `enabled?' from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb: 60:in `assert_enabled' from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/ input_elements.rb:327:in `set' from sub.rb:7 On Jul 28, 4:48 pm, niartseoj niarts...@gmail.com wrote: having problems running scripts using vista, IE8. gem -v returns ruby -e 'require watir; puts Watir::IE::VERSION' things work find in irb. but when i run this it seems that system does not wait for htlm to load. it runs find on xp with same versions # the Watir controller require watir require watir/ie ie = Watir::IE.new ie.goto(http://www.rapidreview.com/sales30/CALogon.jsp;) ie.text_field(:name, 'UserName').set('user') -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
[wtr-general] Re: Fwd: How to automate a scrollbar
Checkout this thread: http://groups.google.com/group/watir-general/browse_thread/thread/a0504c3358716dbb/3b17fb365356c8f1?hl=enlnk=gstq=scroll#3b17fb365356c8f1 Hope it helps. orde On Jul 21, 9:41 am, John Fitisoff jfitis...@yahoo.com wrote: Might be possible to set focus on the element and then use send_keys to hit the down arrow button some number of times to enable the check box. Ugly and not preferred but it might work as a short term fix. From: Basim Baassiri ba...@baassiri.ca To: watir-general@googlegroups.com Sent: Wed, July 21, 2010 8:58:09 AM Subject: Re: [wtr-general] Fwd: How to automate a scrollbar Padma Perhaps a link to a page or some html (and javascript) would be helpful in solving your problem. From the sounds of it, it might be solvable by sending a javascript event or using autoit you could move your mouse to the position of the scrollbar and send mouse clicks or send keyboard spacebar. Without html or code, it makes it extremely difficult to help you Good Luck! On Wed, Jul 21, 2010 at 3:18 AM, Padma Reddy padmaj...@gmail.com wrote: someone please help me out.. its urgent!! Hi all, I need to tick the checkbox and continue to the next page.. but the checkbox will be enabled only when the agreements are read and scrolled down(that particular pane). How to enable the checkbox without scrolling down or how to scrolldown to enable the checkbox?? Please let me knw if u can help. -- Padma -- Before posting, please readhttp://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com -- Before posting, please readhttp://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed tohttp://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
[wtr-general] Re: IE8 Update Broke Watir Support
I'm running the following, but I'm not seeing the problem you describe: IE: 8.0.7600.16385 Ruby version: 1.8.6 WATIR version: 1.6.5 OS: Win7 orde On Jul 20, 6:11 am, mattchurchy mattchur...@gmail.com wrote: Is anyone else having problems getting Watir to work with Internet Explorer 8 after latest minor update pushed out by Microsoft. I'm now on version 8.0.7600.16385. It worked fine until the update yesterday, when `bam` it stopped working. My problem is when calling: @ie = Watir::IE.new @ie.goto(www.google.com) which gives the error: unknown property or method `navigate' HRESULT error code: 0x800706b5 The interface is unknown. The attach method below still works: @ie = Watir::IE.attach(:title,//) I appreciate any feedback. I'd like to know if this is only me. Thanks in advance. - Matt -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
[wtr-general] Re: unable to click image in a div
Did you try just browser.image(:class, gwt-Image).click or browser.image(:class, gwt-Image).fire_event(onload)? orde On Jul 13, 12:59 pm, Basim Baassiri ba...@baassiri.ca wrote: pre-conditions: ruby -v ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32] gem list watir *** LOCAL GEMS *** watir (1.6.5, 1.5.6) Browser: Firefox 3.6.6 HTML Page:http://v.overlay.tv/demo/html5 I've tried the following with no success (didn't respond to clicking of the play button). I used firebug to identify the tag and the attribute class irb(main):032:0 browser.div(:class, 'play-button play-button-up').click = 0 irb(main):034:0 browser.div(:xpath , //d...@class='play-button play-button-up']).exists? = true irb(main):035:0 browser.div(:xpath , //d...@class='play-button play-button-up']).click = 0 irb(main):036:0 browser.div(:xpath , //d...@class='play-button play-button-up']).image(:class, gwt-Image).exists? = true irb(main):037:0 browser.div(:xpath , //d...@class='play-button play-button-up']).image(:class, gwt-Image).click = 0 irb(main):038:0 browser.div(:class, play-button play-button-up).image(:class, gwt-Image).exists? = true irb(main):039:0 browser.div(:class, play-button play-button-up).image(:class, gwt-Image).click = 0 irb(main):040:0 browser.div(:class, play-button play-button-up).image(:class, gwt-Image).fire_event onclick = 0 irb(main):041:0 browser.div(:class, play-button play-button-up).image(:class, gwt-Image).fire_event onclick = 0 irb(main):042:0 browser.div(:class, play-button play-button-up).fire_event onclick = 0 irb(main):043:0 browser.div(:class, play-button play-button-up).fire_event mousedown = 0 irb(main):044:0 browser.div(:class, play-button play-button-up).fire_event mouseup = 0 irb(main):045:0 browser.div(:class, play-button play-button-up).image(:class, gwt-Image).fire_event mousedown = 0 irb(main):046:0 browser.div(:class, play-button play-button-up).image(:class, gwt-Image).fire_event mouseup = 0 Any Ideas? -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
[wtr-general] Re: WatiR Recorder++
Apparently, WatirMaker was renamed WatirRecorder, but it's not clear that it's being actively supported. And I'm going to avoid the debate about the benefits/drawbacks of recorders ;) Here's a download link: http://watir-recorder.openqa.org/ Hope it helps. orde On Jun 23, 1:22 am, Sohail Mirza mrz...@gmail.com wrote: Hi All, Can anyone explain me below points *How to installed Watir Recorder ++?* *What is the difference between WatiR Recorder++ and WatiR Maker?* Best Regards, Sohail -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
[wtr-general] Re: Rich calender how to get value
I google'd up a RichFaces example: http://livedemo.exadel.com/richfaces-demo/richfaces/calendar.jsf. It looks like you don't enter the date into the text field, but-- rather--you click on the calendar icon and select a date. Peeking at the (ajax-heavy) HTML, you'll probably need to click on the calender image and then use the fire_event method to trigger the event handlers in the elements that you need to access. Here's the link to the fire_event documentation: http://wtr.rubyforge.org/rdoc/1.6.5/classes/Watir/Element.html#M000557 Hope it helps. orde On Jun 24, 4:17 am, naresh nareshvatsa...@gmail.com wrote: Hi , Fot input text , text_field method is available. What method is available for following rich calender rich:calendar value=#{eventBean.instance.endDate} timeZone=#{org.jboss.seam.international.timeZone} enableManualInput=true datePattern=dd-MM- id=endDate/ Regards On Jun 24, 4:10 pm, Željko Filipin zeljko.fili...@wa-research.ch wrote: On Thu, Jun 24, 2010 at 1:07 PM, naresh nareshvatsa...@gmail.com wrote: Can anyone guide me how to do that in watir? What is the problem? What have you tried? Is the calendar public, so we could try too? Željko -- watir.com - community manager watirpodcast.com - host testingpodcast.com - audio podcasts on software testing. all of them vidipodkast.com - pričamo o hardveru, softveru i časopisu Vidi -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
[wtr-general] Re: Gif not spawning child element
The anchor tag has event handlers associated with it (e.g. onClick), so you might need to trigger the event. Check this out: http://wtr.rubyforge.org/rdoc/1.6.5/classes/Watir/Element.html#M000557 Example syntax: browser.link(:id, 'id').fire_event('onclick') Hope it helps. On Jun 23, 1:41 pm, Eric Mathiesen mathiese...@gmail.com wrote: Hello all, On input id='customer.tracking_no::0' value='' name='customer.tracking_no' type='hidden' a onClick='root.handleOnClick(document, this);' id='search_customer.tracking_no::0::0' onMouseUp='root.handleOnMouseUp(document, this);' href='#' onMouseDown='root.handleOnMouseDown(document, this);' name='search_customer.tracking_no::0'img width='16' src='/images/icon_magnfi.gif' height='16' border='0' class='cursorHand' id='default::searchrow::TEMPLATE' alt='Search'/a/nobr/td when I attempt to access the gif by clicking (either image or button) or tabbing to and pressing enter I can audibly hear the click sound on the workstation during the script lines; puts image click... ie.frame(app_FinanceCenter).image(:id, default::searchrow::TEMPLATE).click puts button click... ie.frame(app_FinanceCenter).button(:id, default::searchrow::TEMPLATE).click puts simulate tab to and enter... ie.send_keys({TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{ TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{ENTER}) however no child is spawned blocking all the hidden fields from being tested. Has anyone encountered a similar issue? Any help would be greatly appreciated. I have tried accessing this control with id, name, src (xpath) and all to no avail (but I hear the click!) Eric -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
[wtr-general] Re: How to handle a pop up (google chrome)
so i think chromewatir not support popup , am i right? To be honest, I really don't know since I don't use chromewatir and I don't know if chromewatir is actively supported by its primary developer at this point. If there was info on handling popups with chromewatir, I'd expect it to be on that page. Perhaps one of the more informed contributors to this forum would have a better idea (Željko?). On Jun 16, 2:59 am, NumOi3 numobjaka...@gmail.com wrote: thankyou but it still not work i use watir-webdriver to run on google chrome and i didn't found lib - enabled_popup.rb for watir-webdriver and chromewatir too and i can not use click_no_wait method too so i think chromewatir not support popup , am i right? On Jun 16, 4:13 am, orde ohil...@gmail.com wrote: I generally test using IE, but this is the link to the FAQ: http://wiki.openqa.org/display/WTR/Pop+Ups Hope it helps. On Jun 14, 9:20 pm, NumOi3 numobjaka...@gmail.com wrote: Hi All, I am working with web-driver for test google chrome browser. and there's pop up is generated after clicking on a button. i need to click OK button and get text form pop up. How can i access these popup. Please help ... -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
[wtr-general] Re: How to handle a pop up (google chrome)
I generally test using IE, but this is the link to the FAQ: http://wiki.openqa.org/display/WTR/Pop+Ups Hope it helps. On Jun 14, 9:20 pm, NumOi3 numobjaka...@gmail.com wrote: Hi All, I am working with web-driver for test google chrome browser. and there's pop up is generated after clicking on a button. i need to click OK button and get text form pop up. How can i access these popup. Please help ... -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
[wtr-general] Re: How to create a file and save it.
The Ruby IO and File classes contain untold goodies. I'd suggest reading up on them: http://www.ruby-doc.org/core/classes/File.html http://www.ruby-doc.org/core/classes/IO.html Hope it helps. orde On Jun 3, 7:49 am, Adam Reed reed.a...@gmail.com wrote: With respect, file manipulation is a basic feature of Ruby. WATIR is a testing library/tool that makes use of the basic built-in Ruby functionality. That is the distinction that is being made. In your case, you would need to design a way to locate the Order Id, temporarily assign that value to a variable, open or create a text file, and finally write this value to the file. Which step in that process are you having difficulty coding? Thanks, Adam On Jun 3, 9:17 am, meaculpa harismah...@gmail.com wrote: Its WATIR specific only. And This is not a blanket request for help. Everyone in this forum are having experience and they are not just NOOBS. So they can surely understand what i mean... Also After googling only I post here... I believe this group is mainly for helping each other than creating specific rules !!! I accept that my question was little. My actual problem is : From a webpage I get a Order Id. I want to save that in a notepad. I googled and didnt find any help. -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
[wtr-general] Re: not a frame nor form for a newbie....
Sounds like you need to attach to the second browser instance. Check out http://wtr.rubyforge.org/rdoc/1.6.5/classes/Watir/IE.html#M000464 The syntax is like this: browser = Watir::IE.attach(:url, the_url) or browser = Watir::IE.attach(:title, the_title) Hope it helps. orde On May 20, 8:44 am, dave bitdo...@yahoo.com wrote: i'm trying to access a spawned ie window after login...that's neither a frame nor formi think i'm able to startup and login to our workorder system...with this ie = Watir::IE.start('http://cpp-woapp.cpp.org/web/base/logindisp') ...and find the proper places to put the user name and password ...and click the login button: ie.button(:id,'submit').click ...BUT...this complex vendor supplied software (even though the web server and software is all inside our own LAN). 1.) spawns a whole new IE screen(/IE window?) while keeping the original login screen in a completely different IE browser /window. This results in having two IE on my window(XP) minimize bar. 2.) This second spawned window has only a title on it AND i am unable to view any HTML or access any toolbars...nor access through ie methods i know of ..any ideas on how to access this second screen (i've already tried ie.frame and ie.form)...tia dave -- Before posting, please readhttp://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed tohttp://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
[wtr-general] Re: How to access to onclick attribute
Try something like this: browser.link(:text, text).fire_event('onclick') For reference: http://wtr.rubyforge.org/rdoc/1.6.5/classes/Watir/Element.html#M000557 orde On May 5, 7:16 am, Rodrigo rodrigo.bert...@gmail.com wrote: Hi guys, I'm trying to click a button I have on a site I'm working on, but this button is identified by the following tag and properties: a onclick=document.selectterm.submit(); href=#Select/a I've tried to use the different methods to be able to click on the button but no one was successful. Do you mind to give me an idea to resolve this problem? Thanks a lot!! rODRIGO -- Before posting, please readhttp://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed tohttp://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
[wtr-general] Re: synchronisation in ruby
Take a look at http://wtr.rubyforge.org/rdoc/1.6.5/classes/Watir/Waiter.html#M000580. The wait_until method is defined in commonwatir/lib/watir/waiter.rb, and there's an instance method in the Waiter class on line 36 that should do the trick (note: untested): @@default_timeout = 60.0 Hope that helps. orde On Apr 9, 4:24 am, arihan sinha arihan.si...@googlemail.com wrote: I am using wait_until and its working fine and it seems the default value is 60 secs. I mean it waits for 60 secs . If it doesnt find then status is fail. but if I want to change that to say 120 secs ( because in our apps few cases it takes more than 60 secs) then where i need to change. there must be something in the library file where we can change. anyone can suggest pls Thanks Arihan On Mon, Mar 29, 2010 at 3:24 PM, Željko Filipin zeljko.fili...@wa-research.ch wrote: On Mon, Mar 29, 2010 at 4:22 PM, arihan sinha arihan.si...@googlemail.com wrote: can I use the synchronisation statement in the ruby test rather than sleep statement. Did you read this? http://wiki.openqa.org/display/WTR/How+to+wait+with+Watir Željko -- watir.com - community manager pledgie.com/campaigns/2982 - donate to Watir watirpodcast.com - host testingpodcast.com - audio podcasts on software testing. all of them -- Before posting, please readhttp://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@goog legroups.com To unsubscribe from this group, send email to watir-general+ unsubscribegooglegroups.com or reply to this email with the words REMOVE ME as the subject. -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe, reply using remove me as the subject.
[wtr-general] Re: synchronisation in ruby
there's an instance method in the Waiter class on line 36 that should do the trick (note: untested): @@default_timeout = 60.0 I obviously meant class variable ;) On Apr 9, 10:14 am, orde ohil...@gmail.com wrote: Take a look athttp://wtr.rubyforge.org/rdoc/1.6.5/classes/Watir/Waiter.html#M000580. The wait_until method is defined in commonwatir/lib/watir/waiter.rb, and there's an instance method in the Waiter class on line 36 that should do the trick (note: untested): @@default_timeout = 60.0 Hope that helps. orde On Apr 9, 4:24 am, arihan sinha arihan.si...@googlemail.com wrote: I am using wait_until and its working fine and it seems the default value is 60 secs. I mean it waits for 60 secs . If it doesnt find then status is fail. but if I want to change that to say 120 secs ( because in our apps few cases it takes more than 60 secs) then where i need to change. there must be something in the library file where we can change. anyone can suggest pls Thanks Arihan On Mon, Mar 29, 2010 at 3:24 PM, Željko Filipin zeljko.fili...@wa-research.ch wrote: On Mon, Mar 29, 2010 at 4:22 PM, arihan sinha arihan.si...@googlemail.com wrote: can I use the synchronisation statement in the ruby test rather than sleep statement. Did you read this? http://wiki.openqa.org/display/WTR/How+to+wait+with+Watir Željko -- watir.com - community manager pledgie.com/campaigns/2982 - donate to Watir watirpodcast.com - host testingpodcast.com - audio podcasts on software testing. all of them -- Before posting, please readhttp://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@goog legroups.com To unsubscribe from this group, send email to watir-general+ unsubscribegooglegroups.com or reply to this email with the words REMOVE ME as the subject. -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe, reply using remove me as the subject.
[wtr-general] Re: How can I send a keystrokes using Watir?
autoit is installed with watir. You don't need to require it, but you'll need to make sure the .dll is registered correctly. If you run into problems, check out http://wiki.openqa.org/display/WTR/FAQ#FAQ-HowdoIfixaWIN32OLERuntimeErrorwhenIuseAutoIt%3F send_keys is a method that allows you to execute autoit commands within watir scripts. You can check out the send_keys method on http://wtr.rubyforge.org/rdoc/1.6.5/classes/Watir/IE.html#M000497. Hope that helps. orde On Apr 4, 6:31 pm, Rats crapats...@yahoo.com.au wrote: On Apr 2, 4:27 am, orde ohil...@gmail.com wrote: Use autoit (http://www.autoitscript.com). Here's the function list for Send:http://www.autoitscript.com/autoit3/docs/functions/Send.htm Example syntax: browser.send_keys({TAB}{DOWN}) Thanks for your reply. I am however a little bit confused by what you've written. I got send_keys to work just like in autoit. However I don't understand what you mean by use autoit. Are you saying you can use autoit directly from within Watir? Is this by doing a require 'autoit' or something similar? -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe, reply using remove me as the subject.
[wtr-general] Re: How can I send a keystrokes using Watir?
Use autoit (http://www.autoitscript.com). Here's the function list for Send: http://www.autoitscript.com/autoit3/docs/functions/Send.htm Example syntax: browser.send_keys({TAB}{DOWN}) On Mar 31, 7:03 pm, Rats crapats...@yahoo.com.au wrote: Ok, I've successfully clicked on a link and a new page opens. All I want to do now is to send two keystokes i.e. tab and then a down arrow. Is there a way to do this using Watir? -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com To unsubscribe, reply using remove me as the subject.
[wtr-general] Re: HP acquires the Watir project, announces Wativ
Alister/Z - Let me know if you need rides to/from the airport. Then again, you probably have a limo waiting (after flying 1st class, naturally). On Apr 1, 8:28 am, jw joshuawal...@gmail.com wrote: good one Alister! I usually get taken on this day but everybody at my office said to expect pranks : ) On Apr 1, 5:23 am, Don Taylor don.tay...@jmedia.com.au wrote: it would be a pity if all this turned out to be the work of a juvenile few who treat Watir as their plaything. just glad I've found TestWise developed by someone who is committed to providing a tool for test automation. Don _ From: watir-general@googlegroups.com [mailto:watir-gene...@googlegroups.com] On Behalf Of ®eljko Filipin Sent: Thursday, 1 April 2010 9:05 PM To: watir-general@googlegroups.com; watir Subject: Re: [wtr-general] HP acquires the Watir project, announces Wativ Alister and I are flying to HP headquarters (Palo Alto, Calif.) as I write this (from the plane). We have heard that Watir users are gathering in front of the headquarters. There are some rumors about them having signs and shouting stuff. I hope we will manage to record a podcast with a few of the Watir users and hear what they think. ®eljko -- Before posting, please readhttp://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed tohttp://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com To unsubscribe, reply using remove me as the subject.
[wtr-general] Re: Same word different places on the page.
Something like this should work: browser.link(:index=0, :text=Share).click Watir uses zero-based indexing (although I think firewatir is different). So, the example above would click on the first link where the text is Share. Hope it helps. On Mar 11, 3:09 pm, Shlomit Gazit shlomitpatr...@gmail.com wrote: I need to look for the word 'Share' in related to different texts in different places in the page, but the link has the same properties. How can I distinguish. Any ideas? -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
[wtr-general] Re: Dealing with the  character
Nice that you got it worked out. One question, though. Open IE, go to the website you're testing, right click, and select Encoding. Is Unicode (UTF-8) selected? On Mar 10, 8:26 am, George george.sand...@gmail.com wrote: I'm using IE. I tried using gsub!(/Â/, ), but I couldn't remove the remaining spaces. It took a long time, but I think I figured it out using this: x = 3       Jubitz Travel Center               Portland,OR b = x.gsub(x[/(\d+)(\b[^0-9A-Za-z]{1,}\b)/], '') # gets rid of the beginning number/funky chars puts b.gsub(b[/(\b[^0-9A-Za-z]{1,}\b)(\w+)(,..)\Z/], '') # gets rid of the second set of funky chars and city/state On Mar 9, 3:36 pm, Ethan notet...@gmail.com wrote: Is this in IE or firefox? -- You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general
[wtr-general] Re: Dealing with the  character
You should be able to select Unicode (UTF-8) from that dropdown. That might fix the  issue that you're observing. On Mar 10, 10:04 am, George george.sand...@gmail.com wrote: It appears that Western European (ISO) is selected by default. Is there something I can do in the code to convert it to UTF-8? On Mar 10, 9:44 am, orde ohil...@gmail.com wrote: Nice that you got it worked out. One question, though. Open IE, go to the website you're testing, right click, and select Encoding. Is Unicode (UTF-8) selected? On Mar 10, 8:26 am, George george.sand...@gmail.com wrote: I'm using IE. I tried using gsub!(/Â/, ), but I couldn't remove the remaining spaces. It took a long time, but I think I figured it out using this: x = 3       Jubitz Travel Center               Portland,OR b = x.gsub(x[/(\d+)(\b[^0-9A-Za-z]{1,}\b)/], '') # gets rid of the beginning number/funky chars puts b.gsub(b[/(\b[^0-9A-Za-z]{1,}\b)(\w+)(,..)\Z/], '') # gets rid of the second set of funky chars and city/state On Mar 9, 3:36 pm, Ethan notet...@gmail.com wrote: Is this in IE or firefox? -- You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general
[wtr-general] Re: Gmail compose automation
Developing and maintaining gmail scripts will be a challenge. If you're committed to it, search this forum, and there are a few threads that might help. For example: http://groups.google.com/group/watir-general/browse_thread/thread/d6ffd6abde7e711c/14f71f58ec631893?lnk=gstq=automating+gmail#14f71f58ec631893 http://groups.google.com/group/watir-general/browse_thread/thread/4b5b7622f4ad8a82/ceb6a3d140a7f0ec?lnk=gstq=automating+gmail#ceb6a3d140a7f0ec If you can avoid automating gmail, I'd strongly advise it. Hope that helps.. orde On Mar 10, 3:21 am, Dilip M lovingdilip...@gmail.com wrote: Hi all, I am automating gmail..while i am doing so i encountered a problem.. i will explain here that problem plz can any one solve and guide me to solve.. i can able to login successfully.then after while composing a mail i can flash that compose using $ie.frame(:name,main).frame(:name,v1).span(:text,Compose Mail).flash even its going to flash.. and also i can click that using $ie.frame(:name,main).frame(:name,v1).span(:text,Compose Mail).click its going to click.. but its not opening that new compose window.. i mean simply its clicking that but its not functioning properly plz.. try and solve this problem... if any one has solution plz. mail me... Thanks In advance.. Dilip.M mai at : lovingdilip...@gmail.com -- You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general
[wtr-general] Re: Dealing with the  character
This will remove each  character from the string: x = 3       Jubitz Travel Center               Portland,OR x.gsub!(/Â/, ) But you're probably looking to solve your root problem. Looks like a UTF-8 vs. ISO-8859-1 issue. Do a search for utf-8  as a space on your favorite search engine, and that should point you in the right direction (hopefully). Hope that helps. orde On Mar 9, 8:58 am, George george.sand...@gmail.com wrote: I'm not sure if this is a Watir or a Ruby question. I'm pulling all the contents from a select list, and when I display each option, I get something similar to the following (without the quotes): 3       Jubitz Travel Center               Portland,OR Is there something in Watir that will get rid of the  character? Is this related to UTF-8? Ultimately, I'm trying to isolate Jubitz Travel Center from the text string. If someone can help, I would be most grateful! Thanks, George -- You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general
[wtr-general] Re: Measure download time of a file using watir
Is a Download Complete popup actually displayed? If not, then that example won't work. ai.ControlClick(Save As, , Save, left) and ai.ControlClick(Download complete, , Close) provide 2 distinct code points around the download process. If possible, you need to identify a second one (e.g. a Download Complete prompt). Otherwise, maybe something like this (untested): ### ai.ControlSend(Save As, , Edit1, file_to_download) ai.ControlClick(Save As, , Save, left) time_start = Time.now until File.exist?(filename) File.size(filename) == known_file_size end time_end = Time.now ### Take a look at the File class. It's packed with cool stuff. Hope it helps. On Feb 11, 8:53 pm, Maumita maumita.majum...@gmail.com wrote: Hi, I made the changes as per the suggesstion.Below find my modified script But my script gets ended once the file starts downloading. The script is not handling ai.WinWait(Download complete, , 5) ai.ControlClick(Download complete, , Close) Please help on this. I am using watir-1.6.2 require 'watir' require 'win32ole' $ie = Watir::IE.new $ie.goto(http://localhost/dportal;) $ie.image(:name, 'toplogo_nav_04_off').click $ie.link(:text, 'Hitach product').click $ie.link(:text, 'File size 220 MB').click_no_wait ai = WIN32OLE.new(AutoItX3.Control) ai.WinWait(File Download, , 5) ai.ControlFocus(File Download, , Save) sleep 1 ai.ControlClick(File Download, , Save, left) ai.WinWait(Save As, , 5) sleep 1 begin_time=Time.now ai.ControlSend(Save As, , Edit1,login.csv) ai.ControlClick(Save As, , Save, left) ai.WinWait(Download complete, , 5) ai.ControlClick(Download complete, , Close) end_time=Time.now p (end_time - begin_time).to_s Thanks Maumita On Feb 11, 11:46 pm, orde ohil...@gmail.com wrote: Is there a Download Complete prompt/popup? If so, you could wrap this section of solution #2, and it will give you an approx. download time. Otherwise, you might be able to use the File class (e.g. see if the downloaded file exists? is the size 220MB?). ### begin_time=Time.now ai.ControlSend(Save As, , Edit1,filepath) ai.ControlClick(Save As, , Save, left) ai.WinWait(Download complete, , 5) ai.ControlClick(Download complete, , Close) end_time=Time.now download_time = time_start - time_end ### Hope it helps. On Feb 11, 2:20 am, Maumita maumita.majum...@gmail.com wrote: require 'watir' require 'win32ole' $ie = Watir::IE.new $ie.goto(http://localhost/dportal;) $ie.image(:name, 'toplogo_nav_04_off').click $ie.link(:text, 'Hitach product').click $ie.link(:text, 'File size 220 MB').click_no_wait prompt_message = Do you want to open or save this file? window_title = File Download save_dialog = WIN32OLE.new(AutoItX3.Control) sleep 1 save_dialog_obtained = save_dialog.WinWaitActive(window_title,prompt_message, 25) save_dialog.ControlFocus(window_title, prompt_message, Save) sleep 1 save_dialog.ControlClick(window_title, prompt_message, Save) saveas_dialog_obtained = save_dialog.WinWait(Save As, Savein, 5) sleep 1 begin_time=Time.now path = File.dirname(D:/ruby/log/).gsub(/ , \\ )+ \\ + login.csv save_dialog.ControlSend(Save As, , Edit1,path) save_dialog.ControlClick(Save As, Save in, Save) end_time=Time.now download_time = time_start - time_end But my scripts exist when the file starts downloading. Please help on this.This is urgent for my project to measure the file download time. Is there any other way to do this? Thanks in advance Maumita On Feb 11, 2:14 am, orde ohil...@gmail.com wrote: I've used solution #2 onhttp://wiki.openqa.org/display/WTR/File+Downloads. You should be able to modify that code to get an approximate download time: time_start = Time.now # code # code time_end = Time.now download_time = time_start - time_end Hope it helps. orde On Feb 10, 1:30 am, Maumita maumita.majum...@gmail.com wrote: Hi, Is this possible to write a watir script that should download a file from website to locally and also to measure how long it takes to download the file. This is a requirement in my project. The main idea is to measure the download time of a file. Please suggest if there is any way to do this. Thanks in advance. Maumita -- You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general
[wtr-general] Re: Measure download time of a file using watir
Is there a Download Complete prompt/popup? If so, you could wrap this section of solution #2, and it will give you an approx. download time. Otherwise, you might be able to use the File class (e.g. see if the downloaded file exists? is the size 220MB?). ### begin_time=Time.now ai.ControlSend(Save As, , Edit1,filepath) ai.ControlClick(Save As, , Save, left) ai.WinWait(Download complete, , 5) ai.ControlClick(Download complete, , Close) end_time=Time.now download_time = time_start - time_end ### Hope it helps. On Feb 11, 2:20 am, Maumita maumita.majum...@gmail.com wrote: require 'watir' require 'win32ole' $ie = Watir::IE.new $ie.goto(http://localhost/dportal;) $ie.image(:name, 'toplogo_nav_04_off').click $ie.link(:text, 'Hitach product').click $ie.link(:text, 'File size 220 MB').click_no_wait prompt_message = Do you want to open or save this file? window_title = File Download save_dialog = WIN32OLE.new(AutoItX3.Control) sleep 1 save_dialog_obtained = save_dialog.WinWaitActive(window_title,prompt_message, 25) save_dialog.ControlFocus(window_title, prompt_message, Save) sleep 1 save_dialog.ControlClick(window_title, prompt_message, Save) saveas_dialog_obtained = save_dialog.WinWait(Save As, Savein, 5) sleep 1 begin_time=Time.now path = File.dirname(D:/ruby/log/).gsub(/ , \\ )+ \\ + login.csv save_dialog.ControlSend(Save As, , Edit1,path) save_dialog.ControlClick(Save As, Save in, Save) end_time=Time.now download_time = time_start - time_end But my scripts exist when the file starts downloading. Please help on this.This is urgent for my project to measure the file download time. Is there any other way to do this? Thanks in advance Maumita On Feb 11, 2:14 am, orde ohil...@gmail.com wrote: I've used solution #2 onhttp://wiki.openqa.org/display/WTR/File+Downloads. You should be able to modify that code to get an approximate download time: time_start = Time.now # code # code time_end = Time.now download_time = time_start - time_end Hope it helps. orde On Feb 10, 1:30 am, Maumita maumita.majum...@gmail.com wrote: Hi, Is this possible to write a watir script that should download a file from website to locally and also to measure how long it takes to download the file. This is a requirement in my project. The main idea is to measure the download time of a file. Please suggest if there is any way to do this. Thanks in advance. Maumita -- You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general
[wtr-general] Re: use verify instead of assert
I'd suggest reading the Test::Unit documentation at http://www.ruby-doc.org/core/classes/Test/Unit.html. The assertions are detailed at http://www.ruby-doc.org/core/classes/Test/Unit/Assertions.html. If you want your script to continue after a failed condition, you could wrap the condition in an if/else statement. Or use begin/rescue/ end: begin # assert/verify something (e.g. assert(browser.link(:id, id).exists?) rescue # log the failure if it fails. end Hopefully, this helps point you in the right direction. orde PS: In terms of best practices for reporting to test results?, you'd likely get various answers to that question. I do know that many of the contributors on this forum use RSpec and hold it in high regard. On Feb 10, 11:42 am, Matt thurman_m...@yahoo.com wrote: Hi, I am new to Watir and trying to figure out the best way to go about validating my AUT. I started out by using the assert method for text checks but do not like that it exits when there is a failure and does not execute the following statements. So my questions are: How is the verify method used? Can I check for objects, properties, text, etc with verify? (need to check for the existence of objects) Which libraries need to be loaded? I added 'require watir/testcase ' as directed in another post and it did not work. I was using it like this: verify($browser.text.include?(Order Now) ) best practices for reporting to test results? Thanks! Matt -- You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general
[wtr-general] Re: Measure download time of a file using watir
I've used solution #2 on http://wiki.openqa.org/display/WTR/File+Downloads. You should be able to modify that code to get an approximate download time: time_start = Time.now # code # code time_end = Time.now download_time = time_start - time_end Hope it helps. orde On Feb 10, 1:30 am, Maumita maumita.majum...@gmail.com wrote: Hi, Is this possible to write a watir script that should download a file from website to locally and also to measure how long it takes to download the file. This is a requirement in my project. The main idea is to measure the download time of a file. Please suggest if there is any way to do this. Thanks in advance. Maumita -- You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general
[wtr-general] Re: div values in table
browser.contains_text(total) is matching against the string total. If you looking check the value of the variable named total, then you would do this: browser.contains_text(#{total}). Also, the .contains_text method has been deprecated in favor of .text.include? See http://wtr.rubyforge.org/rdoc/1.6.5/classes/Watir/PageContainer.html#M000192 orde On Feb 9, 12:14 pm, tester86 sagar.am...@gmail.com wrote: Hi The value 601 is stored in total and I want to make sure that 'total' matches the value on the screen (overall total). Is there any way that I can compare to make sure that is it the correct total. if total 601 and overall total is 601 passed. I tried to do if $b.contains_text(total) but it fails. On Feb 8, 3:02 pm, orde ohil...@gmail.com wrote: The .html method is returning a string value. So, you're adding 14.56 and 85.00 to create 14.5685.00 You need to convert the a and b variables to a numeric class. In this case, you want to use .to_f: total = a.to_f + b.to_f Hope that helps. orde On Feb 8, 12:45 pm, tester86 sagar.am...@gmail.com wrote: Sorry but in IRB when I do a= $b.table(:index, 1)[2][11].html print 14.56 b=$b.table(:index, 1)[2][11].html print 85.00 total = a + b in IRB it returns 14.5685.00 when it should return 99.56 -- You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general
[wtr-general] Re: div values in table
The .html method is returning a string value. So, you're adding 14.56 and 85.00 to create 14.5685.00 You need to convert the a and b variables to a numeric class. In this case, you want to use .to_f: total = a.to_f + b.to_f Hope that helps. orde On Feb 8, 12:45 pm, tester86 sagar.am...@gmail.com wrote: Sorry but in IRB when I do a= $b.table(:index, 1)[2][11].html print 14.56 b=$b.table(:index, 1)[2][11].html print 85.00 total = a + b in IRB it returns 14.5685.00 when it should return 99.56 -- You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general
[wtr-general] Re: how to run watirscript in background
Sorry that didn't work for you. Then again, I'm guess I'm not clear regarding what you're trying to accomplish, either. These pages contain info on the Thread class: http://www.ruby-doc.org/docs/ProgrammingRuby/html/tut_threads.html http://ruby-doc.org/core/classes/Thread.html On Feb 5, 5:33 am, venkat greet.ven...@gmail.com wrote: Added more info. for better understanding my problem... again ran the script, following are the errors: 1) Error: testMasters_All(TestSuite): WIN32OLERuntimeError: OLE error code:0 in Unknown No Description HRESULT error code:0x80070005 Access is denied. C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/input_elements.rb:75:i n `method_missing' C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/input_elements.rb:75:i n `select_item_in_select_list' C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/input_elements.rb:69:i n `each' C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/input_elements.rb:69:i n `select_item_in_select_list' C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/input_elements.rb:46:i n `set' ./CrimeCogTest_AllMasters.rb:414:in `gangSearch' ./CrimeCogTest_AllMasters.rb:408:in `each' ./CrimeCogTest_AllMasters.rb:408:in `gangSearch' ./CrimeCogTest_AllMasters.rb:89:in `testMasters_All' 1) Error: testMasters_All(TestSuite): WIN32OLERuntimeError: unknown property or method `document' HRESULT error code:0x80010108 The object invoked has disconnected from its clients. C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/ie-class.rb:460:in `method_missing' C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/ie-class.rb:460:in `document' C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/locator.rb:44:in `each_element' C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/locator.rb:51:in `locate' C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/container.rb:811:in `locate_tagged_element' C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/image.rb:20:in `locate' C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:53:in `assert_exists' C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:288:in `enabled?' C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:60:in `assert_enabled' C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:233:in `click!' C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:219:in `click' ./CrimeCogTest_AllMasters.rb:430:in `gangSearch' ./CrimeCogTest_AllMasters.rb:89:in `testMasters_All' thanks On Thu, Feb 4, 2010 at 1:44 PM, venkat greet.ven...@gmail.com wrote: Thanks in advance if anybody answers my query here it is: i have my watir script named login.rb which checks the functionality of Login, go to Inbox then Logout from Gmail website. If I run this login.rb using google loadtest example, it fails with multiple users (#5), multiple iterations(5). Hence I want run these tests in the background process without seeing on the functional GUI navigation on windows. Would there be any solution to run my tests for load in the backgound? One of my friend's friend gave me clue that it can be done using Fork...Spawn...with parent process/ child process even in windows too... Please help me venkat -- You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general
[wtr-general] Re: how to run watirscript in background
You can set the browser as invisible after launching the browser (from http://wtr.rubyforge.org/rdoc/1.6.5/classes/Watir/IE.html#M000266): browser = Watir::Browser.new browser.visible=(0) Not sure if that's what you're looking for, tho. Hope it helps. orde On Feb 4, 12:14 am, venkat greet.ven...@gmail.com wrote: Thanks in advance if anybody answers my query here it is: i have my watir script named login.rb which checks the functionality of Login, go to Inbox then Logout from Gmail website. If I run this login.rb using google loadtest example, it fails with multiple users (#5), multiple iterations(5). Hence I want run these tests in the background process without seeing on the functional GUI navigation on windows. Would there be any solution to run my tests for load in the backgound? One of my friend's friend gave me clue that it can be done using Fork...Spawn...with parent process/ child process even in windows too... Please help me venkat -- You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general
[wtr-general] Re: Handle Failures in Watir
You could do it a couple of ways. 1. Use an if/else statement (as seen here - http://wiki.openqa.org/display/WTR/Example+Logging) if condition=true # log pass else # log fail end 2. Use the Exception class: Here's the basic syntax: begin # do something rescue # log the failure if it fails. end For more detailed info, I'd strongly suggest getting familiar with http://www.ruby-doc.org/docs/ProgrammingRuby/html/tut_exceptions.html and/or http://www.ruby-doc.org/core/classes/Exception.html orde On Feb 4, 8:55 am, tester86 sagar.am...@gmail.com wrote: Hi Question for the watir group. When I run my test sometimes it fails if it cannot find an element or input field. Is there a way that when this occurs it can log that failure and continue running the tests and not stop. Is there any Watir commands that I can put in place at points in my script to cope with failures? I am using the ruby logger to output all my result into a text file. -- You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general
[wtr-general] Re: Watir debug logging
Ruby has a Logger class: http://www.ruby-doc.org/core/classes/Logger.html It should deliver exactly what you're looking for. Hope it helps. orde On Feb 1, 2:02 am, fharper1961 fhar...@greenliff.com wrote: Hi everyone, I've started using Watir, and it would seem really useful if Watir could generate a DEBUG level log. What I mean, is that by setting a Watir option, a log would be generated that contains all the user input. The result would be something along the lines of D, [10:05:15#2372] DEBUG -- : Goto URLhttp://xxx.yyy.com:8020/foo/bar/ D, [10:05:23#2372] DEBUG -- : Clicking on linkhttp://xxx.yyy.com:8020/foo/bar/viewer/results/list?category=2 Does such a feature already exist? -- You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general
[wtr-general] Re: Issue with clicking submit in a site modal window
Check out http://jira.openqa.org/browse/WTR. Click Components SafariWatir. On Jan 29, 9:14 am, QAguy qablogm...@gmail.com wrote: Where can one find the list of open safariwatir bugs to see if this is listed? On Jan 29, 6:01 am, Yuping Zhong littlezhong...@gmail.com wrote: I think it is a bug for SafariWatir. On Wed, Jan 27, 2010 at 1:01 AM, QAguy qablogm...@gmail.com wrote: The site I am testing has a page where I if I click on a specific element I can modify its properties by opening a modal window. In the modal window I enter in the needed data then click submit using: browser.link(:class, create_and_move_button).click The link is highlighted in yellow in the modal window but the link is not actually clicked (i.e the model never closes and the object's properties are not updated). I am using Safariwaitr. Has anyone else had this kind of issue? Thanks -- You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -- You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general
[wtr-general] Re: File Download - Security Warning popup
I have previously used solution 2 on http://wiki.openqa.org/display/WTR/File+Downloads for downloading files. You'd have to tweak it (e.g. for starters, change File Download to File Download - Security Warning; change Save to Run), but it should get you going in the right direction. Hope it helps. orde On Jan 25, 4:30 pm, capri capricorn...@gmail.com wrote: I replaced click with click_no_wait in my code..doesn't seem to work.. just stalls at this point and doesnt proceed further to click the 'Run' button of the file download - security warning window. any thoughts on this? many thanks.. On Jan 23, 6:19 am, Arihan arihan.si...@googlemail.com wrote: Pls use clicknowait method .. It would work .. Sent from my iPhone On 22 Jan 2010, at 22:53, capri capricorn...@gmail.com wrote: Hi, I tried the below code to identify file download -security warning message using autoit in my watir script. However it does not seem to work. I am trying to click the 'Run' button of this window. On running the script, it gets struck and doesn't show any errors. Any thoughts,inputs would be highly appreciated. many thanks. Code: - require 'watir' require 'rubygems' require 'win32ole' # to invoke Autoit controls ie=Watir::IE.new autoit=WIN32OLE.new('AutoItX3.Control') ie.goto http://www.cooliris.com; ie.link(:html,/return InstallHelper.clickedDownload()/).click r=autoit.WinExists(File Download - Security Warning) puts r res=autoit.WinWait(File Download - Security Warning,'',3) puts res res=autoit.WinActivate(File Download - Security Warning) puts res res=ie.autoit.ControlFocus(File Download - Security Warning,, Run) res=ie.autoit.ControlClick(File Download - Security Warning,,Run) puts res puts \n -- You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines:http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/watir-general -- You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general
[wtr-general] Re: File Download - Security Warning popup
Try click_no_wait instead of click on this line: ie.link(:html,/return InstallHelper.clickedDownload()/).click Also, check out: http://wiki.openqa.org/display/WTR/Basic+Authentication Hope it helps. On Jan 22, 2:53 pm, capri capricorn...@gmail.com wrote: Hi, I tried the below code to identify file download -security warning message using autoit in my watir script. However it does not seem to work. I am trying to click the 'Run' button of this window. On running the script, it gets struck and doesn't show any errors. Any thoughts,inputs would be highly appreciated. many thanks. Code: - require 'watir' require 'rubygems' require 'win32ole' # to invoke Autoit controls ie=Watir::IE.new autoit=WIN32OLE.new('AutoItX3.Control') ie.goto http://www.cooliris.com; ie.link(:html,/return InstallHelper.clickedDownload()/).click r=autoit.WinExists(File Download - Security Warning) puts r res=autoit.WinWait(File Download - Security Warning,'',3) puts res res=autoit.WinActivate(File Download - Security Warning) puts res res=ie.autoit.ControlFocus(File Download - Security Warning,, Run) res=ie.autoit.ControlClick(File Download - Security Warning,,Run) puts res puts \n -- You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general
[wtr-general] Re: what watir method use with img tag?
.image is the correct method. You might find this page useful: http://wtr.rubyforge.org/rdoc/classes/Watir/Container.html Also, this (very useful) page summarizes the methods supported by element: http://wiki.openqa.org/display/WTR/Watir+Methods+Supported+by+HTML+Element Hope that helps. orde On Nov 20, 7:49 am, Rodrigo rodrigo.bert...@gmail.com wrote: Hi everybody, I'm having some issues working with img tags. I've tried some methods like ie.button, ie.image, ie.click but no one of them works when running the watir script. This is the html I have: img alt=Manage Account src=/img/buttons/navigation/btn-manage- account.gif/ What method can I use for clicking or getting the Manage account option. Thanks a lor! Rodrigo --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: Calling def cases into a Class
Also, check out http://www.ruby-doc.org/core/classes/Test/Unit.html. Hope it helps. On Nov 13, 3:10 pm, Tiffany Fodor tcfo...@comcast.net wrote: Also, you'll need to require the test file (with a relative path, if it's not in the same directory): require 'test' In case it helps, I've posted an example of a simple Test::Unit framework on the examples page. http://tinyurl.com/yjrrj5a -Tiffany On Nov 13, 4:03 pm, Ethan notet...@gmail.com wrote: The method in the Test::Unit::TestCase subclass needs to start with 'test', which 'my_TestCase' does not. On Fri, Nov 13, 2009 at 16:45, tester86 sagar.am...@gmail.com wrote: I have one file called test.rb which contains: require 'Watir' def test_text_verfication ie=Watir::IE.start(go to url) sleep 5 if ie.text.include? User Login puts at login page else puts not at login page end end The Main file where I want to call that def (test case) and execute it via command line in dos prompt: file name: testfile.rb require 'test/unit' require 'watir' require 'watir/testcase' class MyTest Test::Unit::TestCase def my_TestCase() test_text_verfication() end end When I run my test case I get the following output: default_test(MyTest) [final.rb:18]: No tests were specified. 1 tests, 1 assertions, 1 failures, 0 errors My question is if I have a sepearte file that contains all the def test cases in class how do I call the def test cases? Thanks, tester86 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: Really....Ruby + Watir + Command Line
1. How do I check my envirnoment variables for ruby? This will give you the list (from command line): ruby -e 'puts global_variables.sort' This will give you the value for an individual env var: ruby -e 'puts [env_var]'. For example: ruby - e 'puts $DEBUG' orde On Nov 10, 8:47 am, tester86 sagar.am...@gmail.com wrote: I do not think that it is a permission an issue and I am using windows vista but going to be working on windows 7 soon. I do not know how to get a stack trace from my output. In my previous posts shows the error message that I get in command prompt. Question: 1. How do I check my envirnoment variables for ruby? On Nov 10, 9:38 am, Bret Pettichord b...@pettichord.com wrote: I am wondering if maybe this is a permissions problem. Are you using Windows 7? It would help if you printed the error and stack trace that you are now getting. Bret tester86 wrote: This morning I just upgraded to watir 1.6.2 and I also switched the lines but I still got the same output. On Nov 10, 9:00 am, Jason Trebilcock jason.trebilc...@gmail.com wrote: In a previous email, you indicate that you're running Watir 1.4.1. But, the below indicates that you're on 1.6.2. In any case, I tried running your code and it worked fine. (What happens if you switch the require 'watir' and require 'rubygems' lines? Could that be the source of your problem? Further, do you have the variable RUBYOPT set in your environment variables with the value of 'rubygems'?) That is: require 'watir' require 'rubygems' #require win32ole ie = Watir::IE.new ie.goto(http://google.com;) ie.text_field(:name, q).set(watir) ie.button(:name, btnG).click On Tue, Nov 10, 2009 at 8:42 AM, tester86 sagar.am...@gmail.com wrote: Here is the list of my local gems (just incase its helps) *** LOCAL GEMS *** actionmailer (2.3.4) actionpack (2.3.4) activerecord (2.3.4) activeresource (2.3.4) activesupport (2.3.4) builder (2.1.2) camping (1.5.180) commonwatir (1.6.2) cucumber (0.4.3) diff-lcs (1.1.2) firewatir (1.6.2) fxri (0.3.7, 0.3.6) fxruby (1.6.19, 1.6.12) hoe (2.3.3) hoe-seattlerb (1.2.1) hpricot (0.8.2, 0.6) json_pure (1.1.9) log4r (1.1.2, 1.0.5) markaby (0.5) metaid (1.0) minitest (1.4.2) polyglot (0.2.9) rack (1.0.1) rails (2.3.4) rake (0.8.7, 0.7.3) rspec (1.2.9) rubyforge (2.0.3) rubygems-update (1.3.5) s4t-utils (1.0.4) session (2.4.0) sources (0.0.1) term-ansicolor (1.0.4) test-spec (0.10.0) treetop (1.4.2) user-choices (1.1.6) watir (1.6.2) win32-api (1.4.5, 1.0.4) win32-clipboard (0.5.2, 0.4.3) win32-dir (0.3.5, 0.3.2) win32-eventlog (0.5.2, 0.4.6) win32-file (0.6.3, 0.5.4) win32-file-stat (1.3.4, 1.2.7) win32-process (0.6.1, 0.5.3) win32-sapi (0.1.5, 0.1.4) win32-sound (0.4.2, 0.4.1) win32console (1.2.0) win32ole-pp (1.2.0) windows-api (0.4.0, 0.2.0) windows-pr (1.0.8, 0.7.2) xml-simple (1.0.12) Is there any gem that I am missing that is causing the error? On Nov 10, 8:10 am, tester86 sagar.am...@gmail.com wrote: I removed include Watir now my script is: require 'watir' require 'rubygems' #require win32ole ie = Watir::IE.new ie.goto(http://google.com;) ie.text_field(:name, q).set(watir) ie.button(:name, btnG).click I still get the same error message. I am using watir 1.4.1. Below is my ruby version C:\rubyruby --version ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32] I have done gem update prevsiously, gem system updates but nothing works. Any ideas on what I can do to get a basic script up and running using watir? On Nov 9, 10:52 pm, Raveendran P jazzezr...@gmail.com wrote: Hi, Add first line -- require 'rubygems' Remove line no.2 -- include Watir I hope it works now. If its not working then Please provide more details about Watir Verison and Ruby version. Thanks On Tue, Nov 10, 2009 at 3:19 AM, tester86 sagar.am...@gmail.com wrote: I am trying to run a watir script: require 'watir' include Watir ie = Watir::IE.new ie.goto(http://google.com;) ie.text_field(:name, q).set(watir) ie.button(:name, btnG).submit when I run it from command line ruby filename.rb I get the following error message: c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1336:in `method_missing': unknown proper ty or method `document' (WIN32OLERuntimeError) HRESULT error code:0x800706ba The RPC server is unavailable. from c:/ruby/lib/ruby/ site_ruby/1.8/watir.rb:1336:in `document' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:754:in `getContainerContents' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:778:in `getObject' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3225:in `initialize' from c:/ruby/lib/ruby/site_ruby
[wtr-general] Re: Click ok on popup
Check this out: http://wiki.openqa.org/display/WTR/FAQ#FAQ-HowdoIfixaWIN32OLERuntimeErrorwhenIuseAutoIt%3F Hope that helps. On Oct 26, 10:48 am, Shlomit Gazit shlomitpatr...@gmail.com wrote: I am getting this in the console, but it is not breaking the test, I just need manually to click on both OK buttons. c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ie.rb:113:in `initialize': unknown OLE server: `AutoItX3.Control' (WIN32OLERuntimeError) HRESULT error code:0x800401f3 Invalid class string from c:/ruby/lib/ruby/gems/1.8/gems/ watir-1.6.2/lib/watir/ie.rb:113:in `new' from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ie.rb: 113:in `autoit' from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ WindowHelper.rb:7:in `initialize' from myClicker.rb:6:in `new' from myClicker.rb:6 On Oct 23, 8:59 am, Tiffany Fodor tcfo...@comcast.net wrote: Hi! Just in case you haven't seen this page: http://wiki.openqa.org/display/WTR/JavaScript+Pop+Ups Can you provide the error you're getting when the click doesn't work? Is there a chance that the pop-up isn't loaded yet? You could try troubleshooting with irb and try various commands to click on the button. -Tiffany On Oct 23, 9:19 am,ShlomitGazit shlomitpatr...@gmail.com wrote: Any replies for this one? On Oct 2, 10:21 am,ShlomitGazit shlomitpatr...@gmail.com wrote: For handling prompt popups, I am using myClicker.rb file: ___ $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') if $0 == __FILE__ require 'watir/WindowHelper' $helper = WindowHelper.new $helper.push_confirm_button_ok() I am calling this file like this: __ Thread.new { system(rubyw myClicker.rb) } $ie.image(:name, /elete/).click Thread.new { system(rubyw myClicker.rb) } What I am trying to do above is deleting an object. I am getting first popup asking if I really want to delete this and then a second popup prompt to enter the reason. Both need to click 'ok' button. It is working partly: The problem is that most of the time I have to manually click on ok button. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: how to ALT+Shift+T ?
This should do it: browser.send_keys({SHIFT}{ALT}{T}) On Oct 15, 9:57 am, Paul Rogers paul.rog...@shaw.ca wrote: you'll have to use autoit. This page has the key combinationshttp://www.autoitscript.com/autoit3/docs/functions/Send.htm Paul On Thu, Oct 15, 2009 at 10:36 AM, Andrew andrew.d...@lthree.com wrote: I know this is probably easy. How do you send the key combination ALT- Shift-T to the browser? Andy --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: Check if a Print Dialog appears or not
This thread appears to cover your scenario: http://groups.google.com/group/watir-general/browse_thread/thread/f87efefd3b4a8d7/50ff17894536549b?lnk=gstq=%28hwnd%2C+%22Cancel%22%29#50ff17894536549b Hope that helps. On Oct 13, 1:50 am, Pallavi Sharma write2pall...@gmail.com wrote: Hi I have a scenario in which there is button Print clicking on it a Print Dialog appears. I need to check the appearance of the print dialog box, can anyone here tell me how do I do it? Should i use some AutoIT functionality for this? or is it possible to do using watir? Please do let me know Thanks Pallavi. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: watir tests are not passing on my environment
http://wiki.openqa.org/display/WTR/FAQ#FAQ-HowdoIdealwithtimingissuesandnotusesleep%3F Hope that helps... On Oct 15, 10:55 am, Shlomit Gazit shlomitpatr...@gmail.com wrote: One ting I didnt mention is that the new machine is a VMFusion Windows on MAC. I sometimes success in finding the popup when I am not moving the mouse at all. How do you use wait_until? On Wed, Oct 14, 2009 at 9:18 PM, Bret Pettichord b...@pettichord.comwrote: My guess is that this is Ajax code and that a robust fix would be to add some calls to wait_until. I also suspect that your new environment is using a faster browser and/or version of watir and that this is why you are now seeing timing problems. Bret P.S. The other solution might be to litter your code with sleeps. Just kidding! Shlomit Gazit wrote: One specific example I have: I ran a test that is passing on my old environment and on the new environment it is intermittent. When trying to find popup: The code is: $ie.cell(:class, c2p-action-down-arrow-horizontal).click $ie.link(:id, ID_EDITWATCHERS_MENU).click $ie1 = Watir::IE.attach(:title, /C2P/) $ie1.wait $ie1.select_list(:id, RIGHT_HAND_LIST).select_item_in_select_list(:index, 0) $ie1.image(:src, /button_triangle_left/).click . I got the error: 1) Error: test_issue_top(TC_c2p_all_issues): Watir::Exception::UnknownObjectException: Unable to locate element, using :id, RIGHT_HAND_LIST C:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/element.rb: 52:in `assert_exists' C:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ input_elements.rb:63:in `select_item_in_select_list' C:/Program Files/Genuitec/MyEclipse 7.5/Workspaces/MyEclipse/ c2p_watir/c2p_test_issues_2_menus_dev.rb:67:in `setup' 1 tests, 0 assertions, 0 failures, 1 errors On Oct 14, 12:16 am, Željko Filipin zeljko.fili...@wa-research.ch wrote: 2009/10/14 Shlomit Gazit shlomitpatr...@gmail.com I dont know if a downgrade will solve the problem. I do not know too. Try and let us know. For instance I can click in a frame with the old machine and watir doesnt find it on the new machine. And the error message is? Željko -- Bret Pettichord Lead Developer, Watir,www.watir.com Blog,www.io.com/~wazmo/bloghttp://www.io.com/%7Ewazmo/blog Twitter,www.twitter.com/bpettichord --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: Watir 1.6.5.rc1 - release candidate available for testing - redux
I also experienced the same problem using WinXP SP3 + IE8.x Followed install instructions and tried to check watir version (i.e. ruby -e 'require watir; puts Watir::IE::VERSION' on command line): -e:1: no such file to load -- watir/ie (LoadError) On Oct 9, 1:21 pm, Nathan Lane nathamberl...@gmail.com wrote: I'm usually not very bad at figuring things out, but after I install the gems you've provided, I can't get my Windows Vista IE8 to load with Watir. I get the error that watir/ie does not exist. On Fri, Oct 9, 2009 at 1:43 PM, Charley Baker charley.ba...@gmail.comwrote: Hi all, There's been a lack of feedback on this release candidate. I'm hoping some of you had the chance to test it out. If not, please take some time if you will to run through some of your tests with this build, there have been quite a few fixes and we could use some eyes to check for compatibility issues particularly with Firewatir/Linux/Mac OS X, varying versions of IE, Windows 7, and more. We need to do a bit of cleanup on the wiki and site to update to the latest version number, and there are some last minute potential fixes coming in, however I would like to finalize and release the official 1.6.5 version next week unless we see some additional issues that need to be addressed. Even information like it worked for me with platform X/browser Y with no problems would be great. :) Thanks for your help. Link to the rc1 version: http://wiki.openqa.org/display/WTR/Development+Builds Charley Baker blog:http://blog.charleybaker.org/ Lead Developer, Watir,http://watir.com QA Architect, Gap Inc Direct -- Nathan Lane Blog,http://blog.nathandelane.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: watir:buttons returns only 1st button
Weird. Looks like it's returning the text (i.e. 1st button) instead of the value (first button). I'm not sure why you are getting unexpected results, but here are a couple of things that might help: * button tag isn't the same as input type=button tag * your code below should work if all the buttons are input type=button, like this: input type=button id=1 value=1 button input type=button id=2 value=2 button input type=button id=3 value=3 button Hope that helps. orde On Oct 7, 6:11 am, kat katfor...@gmail.com wrote: Watir:Buttons is supposed to return all buttons on a page. With the next tested page html titlesome title/title body br button id=1 value=first button1st button/button some text button id=2 value=second button2nd button/button input type=button id=6 value=6th button /body /html using this script: require 'watir' test_site = 'http://localhost/test.html' ie = Watir::IE.new ie.goto(test_site) ie.buttons.each do |a_button| puts a_button.value end I get only 1st button in output. Do I do something wrong or this is a bug? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: Close All browsers and Firewatir
According to this page, there's no close_all method for firewatir: http://wiki.openqa.org/display/WTR/Firewatir+Compatibility Could be out of date, though... On Oct 7, 11:28 pm, Pallavi Sharma write2pall...@gmail.com wrote: Hi Is it possible to close all firefox instances open with FireWatir?? Please let me know Thanks Pallavi. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: Iterating through an unordered list
something like this(?): browser.lis.each do |x| puts x.text end Hope that helps. On Oct 8, 2:09 pm, George george.sand...@gmail.com wrote: Hello everyone, Is it possible to iterate each line item (li) text in an unordered list (ul)? Thanks, George --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: need a command to check for a feild is visible or not
Maybe something like: browser.text_field(:id, 'id').visible? http://wtr.rubyforge.org/rdoc/classes/Watir/Element.html#M000318 Hope that helps. On Sep 21, 1:31 pm, ravi ravi8...@gmail.com wrote: I have a situation I have a text box which pops up when I select a option from a selectlist above it, otherwise is is not visible on the screen if I use the command available in watir eval(browser.field).should_not exist - it fails if i say should exist ---it passes I think it is in the dom can you suggest me any options Thanx in advance regards ravi --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: Selecting a url from an array
Ash - glad you got it working. Regarding the regular expression, SciTE recognizes this as valid: $links.detect { |$links| /^http:\/\/word/=~ $links } How is the format incorrect? orde On Sep 14, 2:13 am, ash ashbr...@gmail.com wrote: OK, so I am a plonker. Just needed to store the result of my .detect as a variable then use $browser.goto. Hope I haven't wasted anybody's time. Cheers...Ash On Sep 14, 10:05 am, ash ashbr...@gmail.com wrote: Got it to work now after several iterations. .detect is now giving me the url I need. So how do I select this url? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: Selecting a url from an array
Have tried the line below but it gets confused because of the extra //. $links.detect { |$links| /^http://word/=~ $links } Is it possible to tell watir/ruby to ignore the extra forward slashes? Does this work? $links.detect { |$links| /^http:\/\/word/=~ $links } Hope it helps. On Sep 11, 6:11 am, ash ashbr...@gmail.com wrote: I am using the following to collect all the links on a page and now need to select a particular link to click on; $browser.links.each do |l| #Relative link if (l.href.first == /) $url = $browser.url + l.href[1..-1] else $url = l.href end if !$links.include?($url) $links.push $url end end The following finds the very first link but I need to find the first link that contains a certain word; $links.detect { |$links| /^http/ =~ $links } Have tried the line below but it gets confused because of the extra //. $links.detect { |$links| /^http://word/=~ $links } Is it possible to tell watir/ruby to ignore the extra forward slashes? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: I'm looking for a way to count all PageTo(*) elements or to loop until the bullet_search_white_small.gif doesn't exist in the page
You should take a look at http://wiki.openqa.org/display/WTR/XPath. Something like this should work: puts browser.link(:xpath,//a...@href='/job/peoplesoft-b-test-b-b- analyst-b/brisbane/15956235/']/).text Hope it helps. On Sep 10, 8:32 am, Guy guy.kid...@gmail.com wrote: Hi Orde, It is very helpful and I already put that in my script. I would appreciate help with the next (xpath) I try to get the PEOPLESOFT TEST ANALYST and the date 'Fri 04 Sep' using xpath without getting the right value. Any ideas would be welcome. div id=resultsList class=ol id=searchResultsListlispan class=jobsearchNumber1input type=checkbox name=chkJob onClick=UpdateSelectedItems(); value=15956235/input/ spandivh2a href=/job/peoplesoft-b-test-b-b-analyst-b/brisbane/ 15956235/PEOPLESOFT span class=highlightTEST ANALYST/span/a emIntegrated Business Technologies Pty Ltd/em/h2span class=jobSearchJobListedDateFri 04 Sep/ spandivpImmediate requirement for an experienced PeopleSoft test analyst across HR/Payroll/pspan class=taxonomya href=javascript:ClassTree('catindustry=1215')I.T. amp; T/a gt; a href=javascript:ClassTree ('catoccupation=1491amp;catindustry=1215')QA/Testers/a/span/ divh3Brisbane/h3h3/h3/div/lilispan Many Thanks, Guy On Sep 10, 2:21 am, orde ohil...@gmail.com wrote: This will give you the number of links: browser = [your browser of choice] puts browser.links.length --- To create the loop: while browser.image(:src, /bullet_search_white_small.gif/).exists? puts 'exists' sleep 2 browser.refresh end Hope that helps. orde On Sep 9, 7:56 am, Guy guy.kid...@gmail.com wrote: Hello All, I'm New with watir but appreciate how good it is. I'm looking for a way to count all PageTo(*) elements or to loop until the bullet_search_white_small.gif ('Next' image) doesn't exist in the page Follows is the html code from the site div class='searchPagination'dl class='jobSearchPagination' a class='nextPage btn pinkbtn_small' href=javascript: PageTo (4)strongNextimg src='/general_ID_items/images/other/ bullet_search_white_small.gif'/strong/adtPage/dt dda href=javascript: PageTo(1)1/a/dd dda href=javascript: PageTo(2)2/a/ class='currentPage'span3/span/dd dda href=javascript: PageTo(4)4/a/dd dda href=javascript: PageTo(5)5/a/dd dda href=javascript: PageTo(6)6/a/dd dda href=javascript: PageTo(7)7/a/dd dda href=javascript: PageTo(8)8/a/dd dda href=javascript: PageTo(9)9/a/dd dda href=javascript: PageTo(10)10/a/dd/dl/div /div Cheers, Guy --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: I'm looking for a way to count all PageTo(*) elements or to loop until the bullet_search_white_small.gif doesn't exist in the page
This will give you the number of links: browser = [your browser of choice] puts browser.links.length --- To create the loop: while browser.image(:src, /bullet_search_white_small.gif/).exists? puts 'exists' sleep 2 browser.refresh end Hope that helps. orde On Sep 9, 7:56 am, Guy guy.kid...@gmail.com wrote: Hello All, I'm New with watir but appreciate how good it is. I'm looking for a way to count all PageTo(*) elements or to loop until the bullet_search_white_small.gif ('Next' image) doesn't exist in the page Follows is the html code from the site div class='searchPagination'dl class='jobSearchPagination' a class='nextPage btn pinkbtn_small' href=javascript: PageTo (4)strongNextimg src='/general_ID_items/images/other/ bullet_search_white_small.gif'/strong/adtPage/dt dda href=javascript: PageTo(1)1/a/dd dda href=javascript: PageTo(2)2/a/ class='currentPage'span3/span/dd dda href=javascript: PageTo(4)4/a/dd dda href=javascript: PageTo(5)5/a/dd dda href=javascript: PageTo(6)6/a/dd dda href=javascript: PageTo(7)7/a/dd dda href=javascript: PageTo(8)8/a/dd dda href=javascript: PageTo(9)9/a/dd dda href=javascript: PageTo(10)10/a/dd/dl/div /div Cheers, Guy --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: how to double click on Element
Are you clicking a link on a webpage? Seems unusual that you'd double-click it, but you could just do it twice: browser.link(:id, 'id').click browser.link(:id, 'id').click or 2.times do browser.link(:id, 'id').click end Hope that helps. orde On Aug 26, 10:56 pm, jane.liu jane.li...@hotmail.com wrote: I am a new watir user, now I am writing a function,double click a element in the table,it will jump detail page how I can to deal with double click on Element in watir? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: Multiple attributes don't supported for FRAME element
Check out: http://wiki.openqa.org/display/WTR/Methods+Supported+by+Element Multiple attributes are supported for the frame tag, but the 'class' attribute is not supported for the frame tag. Hope that helps... orde --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: How to click on Ok of a pop-up message window
Check these pages out: http://wiki.openqa.org/display/WTR/Pop+Ups http://wiki.openqa.org/display/WTR/JavaScript+Pop+Ups orde On Jun 23, 5:24 am, Maumita maumita.majum...@gmail.com wrote: Hi, I am facing a problem. I had written a script that submit a form.Befor submitting the form,if any field entry is missing in the form then a java pop-up window appears. Windows title -Microsoft Internet Explorer Prompt Message - 'You have not selected an image.Do you want to continue'. This window has Ok and cancel button. when user clicks on Ok the form automatically gets submitted. I don't know how to click on the OK button when the pop up window appears. Please suggest me. Below is my script - require 'watir' require 'win32ole' include Watir $excel_path = D:/Data/dportalTestScripts/Product.xlsx $sheet_id = 1 $excel = WIN32OLE.new(excel.application) $excel['Visible'] = true; $workbook = $excel.Workbooks.Open $excel_path $worksheet = $workbook.WorkSheets($sheet_id) $worksheet.Select ie = Watir::IE.new #Navigate to dportal ie.goto(http://test/new;) ie.text_field(:name, userName).set() ie.text_field(:name, password).set() ie.button(:value, Login).click ie.link(:text, Manage Products).click ie.link(:text, Create Product).click ie.text_field(:name, productName).set $worksheet.Range(a# {i}).value ie.text_field(:name, description).set $worksheet.Range(b# {i}).value ie.text_field(:name, copyright).set $worksheet.Range(c# {i}).value ie.text_field(:name, 'releaseDate').value= $worksheet.Range(d# {i}).value #ie.fileField(:name, imageFile).set $worksheet.Range(f# {i}).value ie.select_list(:name, vendor).select $worksheet.Range(e# {i}).value ie.select_list(:name, instrument).select $worksheet.Range(f# {i}).value ie.select_list(:name, cds).select $worksheet.Range(g# {i}).value ie.checkbox(:name, isPublished).set ie.text_field(:name, productCosts[0].cost).value= $worksheet.Range(h#{i}).value ie.button(:name, submit_btn).click_no_wait Thanks Maumita --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: firewatir attach() issue
This works in IE: # require 'watir' b = Watir::IE.start('http://www.webdevelopersnotes.com/tutorials/ javascript/creating_opening_new_window_pop_ups_javascript.php3') b.link(:text=/Open a new window/).click b1=Watir::IE.attach(:title,/Welcome/) puts b1.title # Hope that helps... On Jun 19, 11:01 am, sHiVa krapa.ph...@gmail.com wrote: Hello all, My apologizes to all for posting this message even several threads are existed relevant to this topic.I am trying to attach a popup window using firewatir attach command but no luck. 'NoMatchingWindowFoundException' is displayed. Here is my code: #-- require 'firewatir' include FireWatir b=Firefox.new b.goto('http://www.webdevelopersnotes.com/tutorials/javascript/ creating_opening_new_window_pop_ups_javascript.php3') sleep 6 b.link(:text=/Open a new window/).click b1=b.attach(:title,/Welcome/) puts b1.text #- Please help regarding this --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: can I force javascripts links when clicked to load in a new window
Hi Jason-- This thread might help: http://groups.google.com/group/watir-general/browse_thread/thread/d98426e73262f416/05db8fa64b6b8cd6?lnk=gstq=right+click+new+window#05db8fa64b6b8cd6 orde --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---