[wtr-general] Re: watir:buttons returns only 1st button
From the w3c schools Definition and Usage The button tag defines a push button. Inside a button element you can put content, like text or images. This is the difference between this element and buttons created with the input element. Always specify the type attribute for the button. The default type for Internet Explorer is button, while in other browsers (and in the W3C specification) it is submit Browser Support The button tag is supported in all major browsers. Important: If you use the button element in an HTML form, different browsers will submit different values. Internet Explorer will submit the text between the button and /button tags, while other browsers will submit the content of the value attribute. Use the input element to create buttons in an HTML form. Good html code that compiles to a common standard makes a difference... On Oct 9, 4:16 am, kat katfor...@gmail.com wrote: Unfortunately, I cannot change html. Also, this is a real bug. I've submitted it here: tohttp://jira.openqa.org/browse/WTR-326 On Oct 8, 11:25 pm, orde ohil...@gmail.com wrote: 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?- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ 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: ie.goto never returns. Page never loads.
This code snip says it takes about 36 seconds for download complete require 'watir' # use watir gem test_site = 'http://www.igindex.co.uk' # set a variable ie = Watir::Browser.new # open the IE browser ie.goto(test_site) # load url, go to site ie.maximize() sleep(2) ie.bring_to_front() puts ie.down_load_time.to_s I assume you dont care if its complete, just that some object is visible or exists? On Oct 6, 12:01 pm, llemirtrauts smrim...@gmail.com wrote: Hi, I'm pretty new to Watir and I'm having an intermittent problem with scripts hanging when a web page doesn't fully load. I'm trying to run:- Watir::IE.start(http://www.igindex.co.uk;) This sometimes works but sometimes the the start method doesn't return and the script simply hangs indefinitely so the rest of the script doesn't run. The issue with the website in question is probably due to the fact that it maintains a permanent http connection to stream data. This may be causing Watir to think the page hasn't fully loaded. Is there any way to force a Watir script to continue running before it thinks the page has fully loaded? thanks, Stuart --~--~-~--~~~---~--~~ 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: ie.goto never returns. Page never loads.
The site downloads a virus, that looks like Microsoft defender. This violates Microsoft copyright laws On Oct 6, 12:01 pm, llemirtrauts smrim...@gmail.com wrote: Hi, I'm pretty new to Watir and I'm having an intermittent problem with scripts hanging when a web page doesn't fully load. I'm trying to run:- Watir::IE.start(http://www.igindex.co.uk;) This sometimes works but sometimes the the start method doesn't return and the script simply hangs indefinitely so the rest of the script doesn't run. The issue with the website in question is probably due to the fact that it maintains a permanent http connection to stream data. This may be causing Watir to think the page hasn't fully loaded. Is there any way to force a Watir script to continue running before it thinks the page has fully loaded? thanks, Stuart --~--~-~--~~~---~--~~ 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: Getting error unknown property or method `readyState'
Try something like this require 'watir' require 'watir/ie' ie = Watir::IE.new ie.goto 'www.google.com' puts ie.document.readyState On Sep 23, 3:28 am, Maumita maumita.majum...@gmail.com wrote: Hi, In my script, I have included 'readystate', to wait for the age to load completely. But, when I ran my script, it throws an exception - unknown property or method `readyState' Please suggesst, how to solve this issue. 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: How to click on a table cell based on the text string that I know. Ex:- Wilmington.
Well done Satish, Yepper we just gave you some close enuf examples. Glad you caught on and deconstructed the code to what you needed. On Apr 7, 3:41 pm, satish spanchumar...@gmail.com wrote: Thank you Tiffany and SuperKevy, Both solutions are wonderful. Appreciate your help on this. I had to make some changes to work for my schenario. Here is both with changes. # SuperKevy solution.## findUser=Charlotte myTable=ie.table(:id, 'dlgSelectAgency_popup_dlgSelectAgency_gvAgencies_ctl00_DXMainTable') iRows=myTable.row_count() # Rows in the table i=1 while i = iRows do user=myTable[i][1].text puts Row Number: #{i} : Agency Name: #{user}: if user == findUser then myTable [i][1].document.scrollIntoView myTable [i][1].flash myTable [i][1].focus myTable [i][1].click break # Found Break the While Loop end i=i+1 end #Tiffany solution.# # OnMouse over to 'Wilmongton' string, then click on it. i=1 ie.table(:id, 'dlgSelectAgency_popup_dlgSelectAgency_gvAgencies_ctl00_DXMainTable') .rows.each do |row| if row.text.include?('Wilmington') row.fire_event('onmouseover') ie.table(:id, 'dlgSelectAgency_popup_dlgSelectAgency_gvAgencies_ctl00_DXMainTable') [i][1].click end i=i+1 end = Thank you very much, Satish On Apr 7, 3:59 pm, Tiffany Fodor tcfo...@comcast.net wrote: I found this page with Google: http://www.autohotkey.com/docs/commands/Send.htm Does this work? ie.send_keys('{Click}') It really seems like there should be another event you can fire somewhere. I'd navigate through the IE Dev Toolbar output at the table, row and cell levels looking for it. -Tiffany On Apr 7, 1:39 pm, satish spanchumar...@gmail.com wrote: Hi Tiffany, This link has just keyboard commands. Do you know mouse commands? Appreaciate your help. Thank you very much, Satish On Apr 7, 3:18 pm, Tiffany Fodor tcfo...@comcast.net wrote: Here's the list of send key actions: http://www.autoitscript.com/autoit3/docs/appendix/SendKeys.htm to send an Enter: ie.send_keys('{Enter}') I don't think it will work with Firefox, however Does this work? row[1].click #clicking on column 1 of the row, pick any column you like -Tiffany On Apr 7, 12:51 pm, satish spanchumar...@gmail.com wrote: Hi Tiffany, I think your solution is going to work. I have to use left click now to select that text, can you please tell me what is the command for left clicking. is there any reference place for all the commands availabel? Thank you Appreciate your help. Satish On Apr 7, 2:33 pm, Tiffany Fodor tcfo...@comcast.net wrote: Ah - I just looked at your html source and it's not a span. Sorry for the wild guess. Can you get IE Dev Toolbar or Firebug output for the row or element you're trying to select? You can parse through the rows in your table like this: my_table = browser.table(:id, 'table id') my_table.rows.each do |row| if row.text.include?('Wilmington') row.fire_event('onmouseover') end end The row.fire_event('onmouseover') line will depend on what information you get from IE Dev Toolbar or Firebug. How does the user interact with the row? Do they just click on it? You might be able to send a left click or enter with send_keys to select it. -Tiffany On Apr 7, 12:02 pm, Tiffany Fodor tcfo...@comcast.net wrote: Hi Satish! This is just a stab in the dark, but is the text you want to click a span rather than a link? This has been the case for me from time to time. If it is the case for you, you should be able to click it like this: browser.span(:text, 'my text).click or more specifically for a div: browser.div(:id, 'div id').span(:text, 'my text').click Hope this helps! -Tiffany On Apr 7, 11:34 am, satish spanchumar...@gmail.com wrote: Thanks Chuck, I will work with our dev guys to figure it out. Thanks Satish On Apr 7, 12:37 pm, Chuck van der Linden sqa...@gmail.com wrote: There's probably some kind of javascript event being triggered You'll likely need to look at the source to figure out what element it's attached to, figure out how to identify that element, and if the element type doesn't support a click method you'll have to try firing javascript events at it such as mouseup, or mousedown (mouseup is most frequently used to detect clicking on something) On Apr 7, 5:53 am, satish spanchumar
[wtr-general] Re: How to click on a table cell based on the text string that I know. Ex:- Wilmington.
Tiffany has the method. Here's the equivalent as a stupid dog trick Assume a 2 column table the lookup is column 2. Assume there is only 1 table on the page. The action I want is an associated image click in column 1 findUser=Wilmington myTable=ie.table(:index,1) iRows=myTable.row_count() # Rows in the table i=1 while i = iRows do user=myTable[i][2].text if user == findUser then myTable [i][2].document.scrollIntoView myTable [i][1].flash myTable [i][1].image(:alt,'Edit').focus myTable [i][1].image(:alt,'Edit').click break # Found Break the While Loop end i=i+1 end On Apr 7, 1:33 pm, Tiffany Fodor tcfo...@comcast.net wrote: Ah - I just looked at your html source and it's not a span. Sorry for the wild guess. Can you get IE Dev Toolbar or Firebug output for the row or element you're trying to select? You can parse through the rows in your table like this: my_table = browser.table(:id, 'table id') my_table.rows.each do |row| if row.text.include?('Wilmington') row.fire_event('onmouseover') end end The row.fire_event('onmouseover') line will depend on what information you get from IE Dev Toolbar or Firebug. How does the user interact with the row? Do they just click on it? You might be able to send a left click or enter with send_keys to select it. -Tiffany On Apr 7, 12:02 pm, Tiffany Fodor tcfo...@comcast.net wrote: Hi Satish! This is just a stab in the dark, but is the text you want to click a span rather than a link? This has been the case for me from time to time. If it is the case for you, you should be able to click it like this: browser.span(:text, 'my text).click or more specifically for a div: browser.div(:id, 'div id').span(:text, 'my text').click Hope this helps! -Tiffany On Apr 7, 11:34 am, satish spanchumar...@gmail.com wrote: Thanks Chuck, I will work with our dev guys to figure it out. Thanks Satish On Apr 7, 12:37 pm, Chuck van der Linden sqa...@gmail.com wrote: There's probably some kind of javascript event being triggered You'll likely need to look at the source to figure out what element it's attached to, figure out how to identify that element, and if the element type doesn't support a click method you'll have to try firing javascript events at it such as mouseup, or mousedown (mouseup is most frequently used to detect clicking on something) On Apr 7, 5:53 am, satish spanchumar...@gmail.com wrote: Any help on this is greatly appreciated. Thank you Satish On Apr 6, 8:42 pm, satish spanchumar...@gmail.com wrote: Its actually just text not a link. My table has columns 'Agency', City, State. Each row will have data populated. I will have to select a row based on the 'Agency' I want, then only the OK button will get Enabled. Once I select a 'Agency' I could select OK button. Thanks Satish On Apr 6, 6:56 pm, Chuck van der Linden sqa...@gmail.com wrote: is there something more inside the cell than just the text? because normally 'selecting' a table cell does nothing. If there's something in there that you can act on, maybe you should try to address that element, using (:text, 'textyouknow) to identify it. If you need to be sure it's inside the table you can specify it that way (again just like nested tables or frames) e.g if it was a link, then browser.table(stufftoidtable).link(:text, 'textIknow').click by the way I do the same kind of thing with divs.. say that the same link about appears in both a standard footer, and a page specific header, both of which are defined as divs, you can do things like this to make sure you are looking at or working with the correct one browser.div(:id, 'navheader').link(:text, 'about') browser.div(:id, 'footer').link(:text, 'about') On Apr 6, 3:27 pm, satish spanchumar...@gmail.com wrote: I have atableinside that I have 3X3 rows/columns. I need to select a cellbasedontext. Please tell me how to deal with this. HTML tag for the cell is attached under TD tag as #text Ex:- Tableid=tableid TR id=tablerow TD id=tabledataWilmington /TD /TR /Table Thank you very much. Appreciate your help. Satish- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to
[wtr-general] Re: How to print all the methods in the Class or Module out?
Brilliant! On Mar 12, 4:34 am, Željko Filipin zeljko.fili...@wa-research.ch wrote: On Thu, Mar 12, 2009 at 10:32, wesley chen cjq@gmail.com wrote: I would like to print all my methods out. And this is not what you need? class MyClass # some code end variable = MyClass.new variable.methods Željko --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---