[wtr-general] Failed to revoke program remotely from Linux
I developed the program on Windows platform, for our project only support IE. The program works fine on Windows platform. Because other test cases are on Linux platform, we want to integrate all the test cases on the same platform. I need to revoke the program from Linux remotely, and I install cygwin on windows to support this. I login the windows via ssh from linux, and use ruby run.rb to kick off the test, but I got the following error: try to attach to an existing browser ... Error: test_062_15077_create_metadata_uid_check(MULTI_TENANCY): WIN32OLERuntimeError: Windows OLE error code:80040154 in Unknown No Description HRESULT error code:0x80020009 Exception occurred. c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ie-class.rb: 241:in `method_missing' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ie-class.rb: 241:in `each' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ie-class.rb: 265:in `_find' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ie-class.rb: 297:in `attach_browser_window' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ie.rb:102:in `until_with_timeout' c:/ruby/lib/ruby/gems/1.8/gems/commonwatir-1.6.2/lib/watir/ waiter.rb:57:in `wait_until' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ie.rb:102:in `until_with_timeout' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ie-class.rb: 296:in `attach_browser_window' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ie-class.rb: 152:in `_attach_init' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ie-class.rb: 146:in `attach' ./test/maui/./../../lib/everbright/browser.rb:52:in `create' ./test/maui/./../../lib/cig/maui_cigsite.rb:24:in `init' ./test/maui/../../test/maui/multi_Tenancy/ test_062_metadata_uid_check.rb:11:in `test_062_15077_create_metadata_uid_check' I'm very appreciated that if you have any suggestions to resolve this problem. Thanks very much! --~--~-~--~~~---~--~~ 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] Creating Frame objects before a page with a frame exists
Hi, Having trouble creating a frame object before a particular page contains the object. The framework contains an object repository which contains all the objects and methods that act on a particular page. Using textfields, links, buttons etc work fine, because this is not checked on the page if it exists when the object is created. But when creating a frame object, it is checked against the current page if the frame exists, which does not allow you store the frame objects. Below is an example- class Videopage def initialize(brow) usrtxtfield = brow.frame(:id, loginframe).text_field(:id, lgnId1) srchtxtfield = brow.text_field(:id, topQuery2) end #... other methods doing complex steps like login etc end Now the test code will require the above file. require 'watir' require 'watir/ie' require 'Videopage' #--- object repository file class Checktest Test::Unit::TestCase def test_thisframe Watir::Browser.default = ie mybrow = Watir::Browser.new vid = Videopage.new(mybrow) mybrow.goto(http://video.aol.com;) mybrow.link(:text, Sign In).click sleep 5 end end This returns an error in `locate': Unable to locate a frame using id and loginframe. (Watir::Exception::UnknownFrameException) Thanks, Tony --~--~-~--~~~---~--~~ 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] Basic Watir presentation
Hi, Does anyone already have a powerpoint presentaion about Watir (what is it, hopw does it work, benefits, etc)? I will give a basic Watir training to my colleagues and want to create a presentation, but if there is already a good one around, I can use that one. Cheers, John --~--~-~--~~~---~--~~ 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: Browser.url does not return proper URL immediately after a browser.goto statement
Hi. Actually, it doesn't matter if () or {} is used. You just have to use some non-alpha character - for example, let's say that you want to add elements like {one {two {three then you cannot use %w{}, but it would be wise to use %w() instead. Anyway, here are some examples: irb(main):004:0 %w(one two three) = [one, two, three] irb(main):005:0 %w{one two three} = [one, two, three] irb(main):007:0 %w%one two three% = [one, two, three] irb(main):008:0 %w!one two three! = [one, two, three] As you can see, they all return same arrays. It's same as using %q or %Q for strings, that it is up to the developer, which character to use for string start and end. So, like: irb(main):009:0 str = %q(this is a string with some and ' characters, but it works fine) = this is a string with some \ and ' characters, but it works fine Cheers, Jarmo On Mar 26, 6:50 pm, George george.sand...@gmail.com wrote: Hi Kevin, I did a quick check...I think you just need whitespace, not quotes to separate your data using w{}. You'll also need to use {} instead of (). -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] click link in out of focus
Hi All, I need to click a link which is out of focus in the page. I want the particular link or image to be visible and then click it. Can any body throw some light on it Thanks, Venkatesh --~--~-~--~~~---~--~~ 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 use xml element?
You have some xml file opened in IE? Why not just download it and handle it as a regular XML, instead of trying to manipulate it with Watir? On Mar 31, 9:13 am, Angrez Singh ang...@gmail.com wrote: Thanks Vikas, but my problem is not related to reading XML in ruby. --~--~-~--~~~---~--~~ 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] Creating Frame objects before a page with a frame exists
Hi, Having trouble creating a frame object before a particular page contains the object. The framework contains an object repository which contains all the objects and methods that act on a particular page.Using textfields, links, buttons etc work fine, because this is not checked on the page if it exists when the object is created.But when creating a frame object, it is checked against the current page if the frame exists, which does not allow you store the frame objects. Below is an example- class Videopage def initialize(brow) usrtxtfield = brow.frame(:id, loginframe).text_field (:id,lgnId1) srchtxtfield = brow.text_field(:id, topQuery2) end #... other methods doing complex steps like login etc end Now the test code will require the above file. require 'watir' require 'watir/ie' require 'Videopage' #--- object repository file class Checktest Test::Unit::TestCase def test_thisframe Watir::Browser.default = ie mybrow = Watir::Browser.new vid = Videopage.new(mybrow) mybrow.goto(http://video.aol.com;) mybrow.link(:text, Sign In).click sleep 5 end end This returns an error in `locate': Unable to locate a frame using id and loginframe. (Watir::Exception::UnknownFrameException) Is there a way to avoid the frame object from checking if the frame exists on the page when it is being created? Check only when doing an action on the frame or object within the frame. Want it to act like text_fields, buttons , links etc The other way to store the frame object i found was, by using it as a string. Is there any other way ??? example - txtfield = 'mybrow.frame(:id, loginframe).text_field(:id, lgnId1)' eval(txtfield).set(newone) Thanks, Tony --~--~-~--~~~---~--~~ 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: Difference between fire_event(click) and element.click
As I understand, then onfocus event is require prior clicking something? So for example, if uses clicks with mouse, then onfocus event is triggered before actual click? Is this the reason, why at the moment I have to do something like this in my tests to work correctly: button.click button.fire_event(onclick) So, if .click method would do fire_event(onfocus) before clicking itself, then I wouldn't have to specifically call .fire_event (onclick) method itself but it would be called like normally happens with manual interaction? What about text_field and select_list onchange event? It seems that they aren't triggered by Watir either. At the moment I'm just changing text_field value and then firing onchange event manually. Why not make it to trigger automatically also? Jarmo --~--~-~--~~~---~--~~ 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: Basic Watir presentation
On Wed, Apr 8, 2009 at 13:19, JArkelen johnvanarke...@gmail.com wrote: Does anyone already have a powerpoint presentaion about Watir I have something: http://docs.google.com/Present?docid=ddxzzv39_615ggn2m7w4skipauth=true Ž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 -~--~~~~--~~--~--~---
[wtr-general] Re: WatirCraft Environment config file.
Awesome, thanks! New documentation is looking great, by the way! James On Apr 7, 7:41 pm, Bret Pettichord b...@pettichord.com wrote: James wrote: Also, can I set up different variables in the environment config table? For instance, what if I want one environment to be Site A with Login A, and the other environment to be Site B with Login B? I know how to set the URL for the different environments, but can I set other variables that I use within my tests within that file? Yes you can. Details:http://wiki.github.com/bret/watircraft/configuration-options -- Bret Pettichord CTO, WatirCraft LLC,www.watircraft.com Lead Developer, Watir,www.watir.com Blog,www.io.com/~wazmo/blog Twitter,www.twitter.com/bpettichord Watir Training: Portland/Beaverton April 16-17www.watircraft.com/training --~--~-~--~~~---~--~~ 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] Windows Vista task scheduler can not start test.rb
I am facing a weird problem. I can start a test job test.rb by WindowsXP task scheduler, but can not initiate the test job by Windows Vista task scheduler, the test.rb can be run by double click on Windows Vista Explorer. Any help will be highly appreciated. --~--~-~--~~~---~--~~ 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] Tooltip text with overlib
Does anyone have any experience of using overlib with WATiR? Basically, our application uses overlib to display tooltips for as long as the mouse hovers over a help image. I need to check the text of the tooltip that is being returned, but haven't yet found out how - all the tooltips have identical html, with the exception of the returned text (and the Index) i.e. Element: [IMG], Frame: [mainFrame/centralFrame], Index: [95] IMG onmouseover=return overlib('The unique name of this configuration.') onmouseout=return nd(); src=../images/help.gif Any pointers would be appreciated. Trevor --~--~-~--~~~---~--~~ 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
[wtr-general] Re: How to click on a table cell based on the text string that I know. Ex:- Wilmington.
Thank you. On Apr 7, 8:02 pm, KimBrown kimbro...@yahoo.com wrote: One other way that I figure out how to select a certain cell or button is to use a freeware capture/playback tool called Script Recorder. I'll set it to record and click on what I want and the code will almost always be generated (it doesn't handle java popups). Then I cut it and paste it into what I'm working on. You can find it athttp://www.webmetrics.com/products/script_recorder.html. Kim On Apr 7, 1:33 pm, Tiffany Fodor tcfo...@comcast.net wrote: Can you get IE Dev Toolbar or Firebug output for the row or element you're trying to select?- 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: How to click on a table cell based on the text string that I know. Ex:- Wilmington.
Thank you Satish On Apr 8, 10:54 am, SuperKevy kpe...@scholarshipamerica.org wrote: 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
[wtr-general] Re: How to calculate time difference?
require 'time' def time_difference(start_time, end_time) start_time = Time.parse(start_time) end_time = Time.parse(end_time) total_time = end_time - start_time time=Time.local(00:00:00) + total_time return time.to_s.match(/\d{2}:\d{2}:\d{2}/).to_s end puts time_difference(12:23:24, 17:23:22) Thanks. Wesley Chen. On Wed, Apr 8, 2009 at 8:19 PM, Prince3105 prince3...@gmail.com wrote: start_time = Time.parse(start_time) end_time = Time.parse(end_time) total_time = end_time - start_time --~--~-~--~~~---~--~~ 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: Creating Frame objects before a page with a frame exists
Frame object always checked before you can use it. - Original Message From: Tony ynot...@gmail.com To: Watir General watir-general@googlegroups.com Sent: Wednesday, April 8, 2009 2:30:49 AM Subject: [wtr-general] Creating Frame objects before a page with a frame exists Hi, Having trouble creating a frame object before a particular page contains the object. The framework contains an object repository which contains all the objects and methods that act on a particular page.Using textfields, links, buttons etc work fine, because this is not checked on the page if it exists when the object is created.But when creating a frame object, it is checked against the current page if the frame exists, which does not allow you store the frame objects. Below is an example- class Videopage def initialize(brow) usrtxtfield = brow.frame(:id, loginframe).text_field (:id,lgnId1) srchtxtfield = brow.text_field(:id, topQuery2) end #... other methods doing complex steps like login etc end Now the test code will require the above file. require 'watir' require 'watir/ie' require 'Videopage' #--- object repository file class Checktest Test::Unit::TestCase def test_thisframe Watir::Browser.default = ie mybrow = Watir::Browser.new vid = Videopage.new(mybrow) mybrow.goto(http://video.aol.com;) mybrow.link(:text, Sign In).click sleep 5 end end This returns an error in `locate': Unable to locate a frame using id and loginframe. (Watir::Exception::UnknownFrameException) Is there a way to avoid the frame object from checking if the frame exists on the page when it is being created? Check only when doing an action on the frame or object within the frame. Want it to act like text_fields, buttons , links etc The other way to store the frame object i found was, by using it as a string. Is there any other way ??? example - txtfield = 'mybrow.frame(:id, loginframe).text_field(:id, lgnId1)' eval(txtfield).set(newone) Thanks, Tony --~--~-~--~~~---~--~~ 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: Error in handling popup
I grabbed this code from somebody here...this may work (you'll need to install AutoIt): # Create a file clicker.rb require 'win32ole' begin autoit = WIN32OLE.new('AutoItX3.Control') loop do autoit.ControlClick(Windows Internet Explorer, '', 'OK') autoit.ControlClick(Security Information,'', 'Yes') autoit.ControlClick(Security Alert,'', 'Yes') sleep(5) end rescue Exception = e puts e end # create another file called clicker_process.rb require 'watir' require 'win32/process' @pid = Process.create( :app_name = 'ruby clicker.rb', #assuming you make the above script into a file called clicker.rb :creation_flags = Process::DETACHED_PROCESS ).process_id at_exit{ Process.kill(9,@pid) } # ...and here's your main script (delete.rb) require 'watir' require 'win32/process' require 'clicker_process' $ie = Watir::IE.attach(:title, /Your Website Title/) $ie.link(:text, Delete).click # this will trigger a popup window = This should automatically handle popups. You can also expand the list to include other window title aside from 'Windows Internet Explorer', 'Security Information' and 'Security Alert'. Hope this helps! -George On Apr 8, 5:26 am, spike vinaykumarl...@gmail.com wrote: Hi I'm woking on windows platform and IE7 using WATIR I've used the following code for handling JavaScript popup require 'win32ole' wsh WIN32OLE.new('Wscript.Shell') wsh.AppActivate('Windows Internet Explorer') wsh.Sendkeys('{ENTER}') but its not working i'm getting the following error. 1) Error: test_manage_resources(Manageresources): NoMethodError: undefined method `wsh' for #Manageresources:0x2b8c4bc manageresource.rb:24:in `test_manage_resources' Please Please please... give a solution to my problem i'm stuck with handling popup from past 2 days.. thankingyou --~--~-~--~~~---~--~~ 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 returns first element found. How to return all elements found?
I forgot to give an update. Here it is. Tiffany's method worked great. e.g.) ie.div(:class = 'something', :index = 1) I just made the index value a variable and incremented it for every loop iteration. On Apr 6, 10:11 am, IDIEININIIS ideler.den...@gmail.com wrote: @George, Yes they are all divs. @Tiffany, Hi Tiffany, I am trying to get a list of all the objects that are similar. I'm dealing with nested divs in my case. E.g.) I'm after all div class=b (I didn't expand div class a, b and c in this case. But they contain info.) div id=list class=results liclass=x div class=a div class=b div class=c /li liclass=y div class=a div class=b div class=c /li liclass=z div class=a div class=b div class=c /li /div I'll try both methods that you mentioned and will write back if I had any success. Thanks. On Apr 3, 7:51 pm, Tiffany Fodor tcfo...@comcast.net wrote: Hi Dennis! Are you trying to get a list of all of the objects that are similar, or are you trying to perform an action on a specific object that doesn't happen to be the first one? You can specify multiple attributes for an object like this: ie.div(:class = 'something', :index = 1) If you really want a list of all the div objects on your page you can do this: ie.show_divs Hope this helps! -Tiffany On Apr 3, 1:18 pm, Dennis I. ideler.den...@gmail.com wrote: Watir returns the first element found when there are multiple elements with the same name. I'd like for it to return all the elements instead of just the first one found. I know I can do this by using xpath plus an iterator, but is there any other quicker way? e.g.) ie.div(:class, something) would return the first element with the something class attribute. I'd like for it to return ALL something classes in that division. --~--~-~--~~~---~--~~ 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: Error in handling popup
We seem to do just this. I haven't looked at it in awhile so I'm not sure if this is everything. This is in a module. require 'watir\ie' require 'watir\contrib\enabled_popup' # Main method to click a modal dialog button. def click_modal_button(ie, type='OK', sleep_time=6, timeout=20) hwnd = ie.enabled_popup(sleep_time) if (hwnd) w = WinClicker.new w.clickWindowsButton_hwnd( hwnd, #{type}) w=nil end end On Wed, Apr 8, 2009 at 6:26 AM, spike vinaykumarl...@gmail.com wrote: Hi I'm woking on windows platform and IE7 using WATIR I've used the following code for handling JavaScript popup require 'win32ole' wsh WIN32OLE.new('Wscript.Shell') wsh.AppActivate('Windows Internet Explorer') wsh.Sendkeys('{ENTER}') but its not working i'm getting the following error. 1) Error: test_manage_resources(Manageresources): NoMethodError: undefined method `wsh' for #Manageresources:0x2b8c4bc manageresource.rb:24:in `test_manage_resources' Please Please please... give a solution to my problem i'm stuck with handling popup from past 2 days.. thankingyou -- Lisa Crispin Co-author with Janet Gregory, _Agile Testing: A Practical Guide for Testers and Agile Teams_ (Addison-Wesley 2009) http://lisacrispin.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: Are there IE Settings that can cause Watir to fail?
Hi Andrew! Could you please provide a sample of your code and the error you're getting? Thanks! -Tiffany On Apr 8, 12:10 pm, andrew.d...@lthree.com wrote: I am installing on a new machine, and watir fails searcing for its first element (a frame in this case). The exact code works on many other machines. So is there anything about IE that can cause watir to fail like this? Andrew --~--~-~--~~~---~--~~ 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: click link in out of focus
Perhaps: @browser.link(:id, 'link_id').fire_event('onfocus') @browser.link(:id, 'link_id').click Do you have sample HTML? On Apr 8, 5:13 am, venky venkatesh...@gmail.com wrote: Hi All, I need to click a link which is out of focus in the page. I want the particular link or image to be visible and then click it. Can any body throw some light on it Thanks, Venkatesh --~--~-~--~~~---~--~~ 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: Are there IE Settings that can cause Watir to fail?
Here is a code snippet. logon_page.top_frame.contains_text('some text').should_not be_nil in logon_page.rb I have def logon_frame @browser.frame(:id, 'top_frame') end alias :top_frame :logon_frame and I gaurantee that there is a frame with id = 'top_frame' Fails with error message: Then in the Logon page I should see Guidewire ClaimCenter text # teps/then_common.rb:689 Unable to locate a frame with id top_frame (Watir::Exception::UnknownFrame Exception) c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.3/lib/watir/frame.rb: 48:in `locat e' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.3/lib/watir/frame.rb: 55:in `initi alize' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.3/lib/watir/ container.rb:102:in ` new' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.3/lib/watir/ container.rb:102:in ` frame' C:/Users/pinal/workspace/GuideWire/Guidewire/ClaimCenter/lib/ pages/logon_p age.rb:7:in `top_frame' C:/Users/pinal/workspace/GuideWire/Guidewire/Common/lib/steps/ then_common. rb:690:in `Then /^in (?:the )?(.*) page I should see (.*) text$/' test/features/testing.feature:10:in `Then in the Logon page I should see G uidewire ClaimCenter text' By putting some traces in frame.rb inside the watir 1.6.3 project, I know that it is never entering the for loop that loops over all the frames. On Apr 8, 12:11 pm, Tiffany Fodor tcfo...@comcast.net wrote: Hi Andrew! Could you please provide a sample of your code and the error you're getting? Thanks! -Tiffany On Apr 8, 12:10 pm, andrew.d...@lthree.com wrote: I am installing on a new machine, and watir fails searcing for its first element (a frame in this case). The exact code works on many other machines. So is there anything about IE that can cause watir to fail like this? Andrew- 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: Are there IE Settings that can cause Watir to fail?
What OS are you on? is there more than one open IE window on your system or does a second window open when you run the tests? Environments with 'high security' browser stipulations (vista, server 2008) will not allow a browser to have sessions open within it from different security zones. I can't say exactly why MS does this, but I believe it is so all the tabs in the browser session can share the same security settings for things like session level cookies etc. It may also be a security measure to prevent a site in one tab from snooping on session level data like cookies and such from other sites. There's probably a white paper or something somewhere from MS that explains the security benefits from doing things that way. But whatever the reason it can make for some strange behavior when logging into secure or trusted sites if you try to do it from a tab in a browser where the other tabs are pointing at less trusted 'internet zone' sites. No matter the reason, the upshot is that iIf you end up going to a page that requests a different security zone, it will open a new browser session, and when that happens the browser instance in your script is still connected to the original browser, so it doesn't see any of the 'new' content that just arrived over on the new browser instance. My preferred way to solve this (especially if you need to test on vista to ensure compatability) is: 1) set browser homepage to 'blank' 2) add the blank page (usually about:blank) to the same security group (often 'trusted sites') as the site you are testing. 3) unless you want to deal with having to .atttach to new browser sessions, ensure that all the pages you are testing are added to the same security zone in your browser, so it won't have any reason to spawn a new browser instance. Alternatively if you start your browser session by going to a specific page, instead of using .new() that might also eliminate a lot of the troubles, provided you paid attention to #3 above, and all the pages you are testing against are in the same security zone. On Apr 8, 11:33 am, andrew.d...@lthree.com wrote: Here is a code snippet. logon_page.top_frame.contains_text('some text').should_not be_nil in logon_page.rb I have def logon_frame @browser.frame(:id, 'top_frame') end alias :top_frame :logon_frame and I gaurantee that there is a frame with id = 'top_frame' Fails with error message: Then in the Logon page I should see Guidewire ClaimCenter text # teps/then_common.rb:689 Unable to locate a frame with id top_frame (Watir::Exception::UnknownFrame Exception) c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.3/lib/watir/frame.rb: 48:in `locat e' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.3/lib/watir/frame.rb: 55:in `initi alize' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.3/lib/watir/ container.rb:102:in ` new' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.3/lib/watir/ container.rb:102:in ` frame' C:/Users/pinal/workspace/GuideWire/Guidewire/ClaimCenter/lib/ pages/logon_p age.rb:7:in `top_frame' C:/Users/pinal/workspace/GuideWire/Guidewire/Common/lib/steps/ then_common. rb:690:in `Then /^in (?:the )?(.*) page I should see (.*) text$/' test/features/testing.feature:10:in `Then in the Logon page I should see G uidewire ClaimCenter text' By putting some traces in frame.rb inside the watir 1.6.3 project, I know that it is never entering the for loop that loops over all the frames. On Apr 8, 12:11 pm, Tiffany Fodor tcfo...@comcast.net wrote: Hi Andrew! Could you please provide a sample of your code and the error you're getting? Thanks! -Tiffany On Apr 8, 12:10 pm, andrew.d...@lthree.com wrote: I am installing on a new machine, and watir fails searcing for its first element (a frame in this case). The exact code works on many other machines. So is there anything about IE that can cause watir to fail like this? Andrew- 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 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: Tooltip text with overlib
I can see where the html might have identical format, but if it's completely identical I don't understand how it would work, unless it was inside some other container (like a div) that was different.. might be easier if you showed us more of the html, so we could see like 2 or 3 of these things defined, then we might be better able to tell you how you could tell them apart inside your script. On Apr 8, 7:30 am, Trevor ti_ma...@btopenworld.com wrote: Does anyone have any experience of using overlib with WATiR? Basically, our application uses overlib to display tooltips for as long as the mouse hovers over a help image. I need to check the text of the tooltip that is being returned, but haven't yet found out how - all the tooltips have identical html, with the exception of the returned text (and the Index) i.e. Element: [IMG], Frame: [mainFrame/centralFrame], Index: [95] IMG onmouseover=return overlib('The unique name of this configuration.') onmouseout=return nd(); src=../images/help.gif Any pointers would be appreciated. Trevor --~--~-~--~~~---~--~~ 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 get the content in the boolean left and right value??
As the others have indicated you need to pass the values into the method, and then do the equivalency test once you are inside. I defined something like this to do validations for some of my early scripts where I didn't like using assert or should because they would stop, and I wanted to run the other checks in that section. I also defaulted the expected value to 'true' so I could call it with something that just returned true or false (like .exists?) for the actual value, which is also why the parameters are in that order. Mine looked like this (it's using the HTML reporting class from the examples on the wiki, to which I added a blocked status.. I really ought to update that example) def validate(test_title, actual_value, expected_value=true) if actual_value == expected_value $results.addtoReport($testReport, test_title, 'PASSED', Found: # {actual_value}) true else $results.addtoReport($testReport, test_title, 'FAILED', Expected: #{expected_value} Found: #{actual_value}) false end end #end of validate function Here's some examples of how I was using it. # Is there a Login Button? unless validate('Page contains Login Button', $browser.button(:id, 'Login').exists?) $login_page_broken = true #checked by other scenarios that need login to be working in order to run. end # Is there a link for first time users? is it correct? if validate('Page contains link for first time users', $browser.link(:id, 'LoginVerification').exists?) validate('First-time user link has correct url', $browser.link (:id, 'LoginVerification').href, $ESS_SITE + '/LoginVerification.aspx? type=LoginVerification') else $results.addtoReport($testReport, 'Link for first time users is correct', 'BLOCKED', 'Cannot Validate, Link not present') end Note that I've abandoned this approach for now, and am heading in the direction of using Watir, + Watircraft framework + Cucumber which I view as a lot better use of my time than trying to create my own framework. Now if we can just enhance things to support the idea of a 'qa mode' where it will keep going and complete all the 'THEN/AND/AND...' actions even if one .should fails, so I can report all the test criteria's status. I suspect that's something I might have to talk to the Rspec/Cucumber people about however.. Developers want stuff like this to stop at the first failure (it means they have work to do), but for QA folks that's bad because it 'masks' the results of following items that I want to be able to report status on without having to create atomic level scenarios. On Apr 7, 10:10 pm, Wesley Chen cjq@gmail.com wrote: Hi, All, Suppose I would like to write a method like. def test(boolean, message) if boolean puts message else puts boolean.left_value puts boolean.right_value end end Sometimes, I have to invoke the methods like: test(arra.include?(arrb), arra includes arrb) test(arra.eql?(arrb), arra equals to arrb) When the boolean is not true, I would like to get the info why they don't match/equal/include. Any suggestion would be quite appreciated. Thanks. Wesley Chen. --~--~-~--~~~---~--~~ 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: Organization and execution of test cases.
On Apr 7, 11:29 am, Bret Pettichord b...@pettichord.com wrote: Calm down. The original poster asked what do people use. People should be able to share what they are using, when asked, without being obliged to provide a tutorial. I am calm. Although I should have phrased that better. I can see how it might have read as being critical of JArkelen, which what wasn't what I intended when I .started. the response, but after a few edits it obviously ended up that way. My intent had been to provide a little more value to the newer folks who might not be familiar with Rake..Especially since the OP indicated they were 'just getting into watir', I thought a little more detail might be helpful. Sorry it came out wrong. --~--~-~--~~~---~--~~ 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: Basic Watir Help
We have to pick our battles.. Sounds like you've thought this one through and I can't say I'd not make the exact same choice to just 'live with it' given what you've described as being the situation. Especially if this is old and established code that as you say is not likely to change (sometimes a very dangerous assumption).. OTOH if this is something that's being actively developed right now, and is fresh from a developer's keyboard, then it might be worth a discussion regarding making it easier to test. On Apr 7, 3:39 pm, catepillar cmay...@gmail.com wrote: Yea, it is really bad code. And, I have just been told to see if its easy to reverse make a spreadsheet of what has already been made. I do what I am told. There probably wont be any changes to the code, and if there is, I can manage it. The script I am writing really is not all that complex. Thank you for all the help! Chris On Apr 7, 11:56 am, Chuck van der Linden sqa...@gmail.com wrote: On Apr 7, 3:13 am, catepillar cmay...@gmail.com wrote: Hahaha. Will do. This is just a random question, but what would you do if there were no id tag. So the code looked something like: div div4/2/div div97/div div95/div div100/div /div Now there is nothing to set them apart, but I would still need to set them to individual variables. What Would I do? The first thing I'd do is have a serious talk with my developers about this concept called 'testability' Then I'd ask to see their unit tests for this stuff and try to figure out how they are not going to break the first time the dev refactors the page. because yes you can access these by index, but since the index could easily change with the addition of just one more div above it on the page, it creates a test that tends to be very fragile, high maintainance, and prone to false alarms. None of that is good... having something simple like an ID or Title in the divs so that they can be easily identified will make life easier for everyone.- 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: Organization and execution of test cases.
Thank you everyone for your comments. I've gotten watircraft working for me quite well, especially now that new documentation for it has been posted. I don't mind short answers to my questions, as long as people don't mind me asking following up questions if I don't understand what something is. Jarkelen's post was, in fast, the first I had heard of Rake, but a quick google search and it was easy to find documentation for it. So far I have found that this group is -very- friendly to new users, something that I took for granted before making a post or two in a couple other technical sites this week and getting not so friendly responses. So thanks all for your kind help, this group has been an extremely useful resource for me! --~--~-~--~~~---~--~~ 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] Host our next Intro to Watir class?
On April 16 and 17, Bret will be teaching Intro to Watir in the Portland, OR area. We were able to do this thanks to Keith Hamilton and the good people at Transcore, who offered to host the class at their facility. We'd like to hold our next public class soon - in May, or June at the latest - someplace in N. America. What we need to make this happen is a sponsoring company. Could that be you? Maybe your company is moving to Watir and this would be a good chance to get everyone off to a fast start. The class includes the new WatirCraft framework. Please contact pete at watircraft dot com if you may be interested in hosting a class. Thanks! http://www.watircraft.com/watir-training/ Pete --~--~-~--~~~---~--~~ 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: uninitialized constant Windows::API::Error (NameError)
Had the same issue on Windows XP test machine here when upgrading framework to use watir 1.6.2 and Ruby 1.8.6-26 We had windows-pr-0.9.6.gem installed with watir 1.6.2 I upgraded to following gems and it's fine windows-pr-1.0.2 windows-api-0.3.0.gem win32-api-1.4.0-x86-mswin32-60.gem fyi: We maintain a private cache of gems here so I can prepackage installation on our test machines here with rake tasks On Apr 7, 3:13 am, frank.li lizhiguoem...@gmail.com wrote: This issue is windows-pr version resolution: Gem uninstall windows-pr Gem install windows-pr answer from http://www.zhuaijun.cn/archives/53 On 3月30日, 下午11时22分, Dennis I. ideler.den...@gmail.com wrote: I tried installing Watir at home a while ago and kept getting an error. I followed some instructions here from a different discussion that mentioned installing and reinstalling some gems. That didn't work. And today I tried again. Here is the error that I get. ruby test.rb C:/Ruby/lib/ruby/gems/1.8/gems/windows-pr-0.9.3/lib/windows/thread.rb: 59: uninitialized constant Windows::API::Error (NameError) from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' from C:/Ruby/lib/ruby/gems/1.8/gems/win32-process-0.5.9/lib/win32/ process.rb:3 from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' from C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ie- process.rb:1 from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' from C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ie.rb:45 from test.rb:22 Test executed on Mon Mar 30 12:14:05 -0300 2009 Here is the code until where it gets stuck: require 'watir' time = Time.now.to_s puts Test executed on +time test_site = http://www.google.com; ie = Watir::IE.open(test_site) # this is line 22 --~--~-~--~~~---~--~~ 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: Difference between fire_event(click) and element.click
On Apr 8, 5:26 am, Jarmo Pertman jarm...@gmail.com wrote: As I understand, then onfocus event is require prior clicking something? So for example, if uses clicks with mouse, then onfocus event is triggered before actual click? I don't belive it's 'required' or the .click method would not work at all, and for most of us it works quite well. Actually I believe that when the user clicks the mouse in the UI there are a series of events that the browser fires off focus, mousedown, mouseup, click These are not 'required' they are merely what happens. how the UI reacts will depend on which of these methods have been implemented for a given element in the client side javascript, and/or what kind fo element you are clicking on There's also I believe a time proximity between the mousedown and mouseup that is required for an actual click event to be issued. Brett can correct me if I'm remembering right but I seem to recall he said that Watir is firing off mouseup when the click method is used. Is this the reason, why at the moment I have to do something like this in my tests to work correctly: button.click button.fire_event(onclick) So, if .click method would do fire_event(onfocus) before clicking itself, then I wouldn't have to specifically call .fire_event (onclick) method itself but it would be called like normally happens with manual interaction? What about text_field and select_list onchange event? It seems that they aren't triggered by Watir either. At the moment I'm just changing text_field value and then firing onchange event manually. Why not make it to trigger automatically also? Perhaps because a lot of sites don't take any action when the selection in a selection list is changed, so the code works just fine in a majority of cases without doing this. OTOH in terms of fooling the system to think there's really a user out there at the other end of the mouse, it might not be a bad idea to consider firing off all the events that would normally happen when a user manually selects something from a selection list. --~--~-~--~~~---~--~~ 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] Posting invalid form data with Watir
In previous versions of watir I used to send 11 characters to a field that had a maxlimit of 10. This would ensure the server also checked the parameter and did something sensible (truncate or error message). The newer version seems a bit safer and ie.text_field (:index,1).set (01234567890) just truncates the input to the maxlength. Ok I accept that and found I could use ie.text_field (:index, 1).value=01234567890 in the instances where I wanted to do the server side validation. NOW THE PROBLEM How do I do that for a combo box? I want to send a value that is not in the list of options. One way might be to add the item and then send it (sorta the same thing I guess). In any case the server should again check and handle this. And I bet the next question I ask will be around Radios and Checkboxes? Setting/sending invalid values. BACKGROUND For those unfamiliar with OWASP threats (google that) and see that this is amongst the most common vulnerabilities in security. You cannot assume the web browser will safeguard inputs. In fact till now we have manually used Firefox and Tamperdata to do this. But the task is very difficult and time consuming - So I want to automate these tests too. --~--~-~--~~~---~--~~ 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 get the content in the boolean left and right value??
Hi, Chuck, :), to be honest, in my current code, I have the same approach as you have used before. In the approach, I can abandon the verify or assert completely. I think it is not good enough. Maybe I have to spend some time on Watircraft. Maybe I can make my frame easier, :). Thanks. Wesley Chen. On Thu, Apr 9, 2009 at 3:35 AM, Chuck van der Linden sqa...@gmail.comwrote: e first failure (it means th --~--~-~--~~~---~--~~ 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] Regex question
I have a string obj_url = http://crisp.adoc.xerox.com:8080/docushare/dsweb/Get/ Document-77/ and need to extract 77. This code works perfect: handle = /.*Document-(.*)\//.match( obj_url ) puts handle[ 1 ] # returns 77 but this code does not work: obj_type = Document str = '.*' + obj_type +'-(.*)\/' handle = /str/.match( obj_url ) Please, help. Thanks, Vladimir --~--~-~--~~~---~--~~ 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: Regex question
When using regular expression with a variable, the syntax is /#{str}/ On Wed, Apr 8, 2009 at 9:30 PM, vladimir...@hotmail.com vladimir...@hotmail.com wrote: I have a string obj_url = http://crisp.adoc.xerox.com:8080/docushare/dsweb/Get/ Document-77/ and need to extract 77. This code works perfect: handle = /.*Document-(.*)\//.match( obj_url ) puts handle[ 1 ] # returns 77 but this code does not work: obj_type = Document str = '.*' + obj_type +'-(.*)\/' handle = /str/.match( obj_url ) Please, help. Thanks, Vladimir --~--~-~--~~~---~--~~ 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] Go on performance test using script.
Hi, All, I have heard that, we can go on performance test, such as load/stress test by script. So I would like to study one script language for it. I think in this great Watir general group, there are many testers going on performance testing. Any of you do the performance testing by manual script? It is said that, python, jython by frame Grinder may be good. Which script would be perfect to choose for the performance test? Can you guys show your opinion and some documents/articles links? Thanks. Wesley Chen. --~--~-~--~~~---~--~~ 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] firewatir, xpath and GL
Our app uses GL. Here's a snippet of a page source: ?xml version=1.0? ?xml-stylesheet href=chrome://global/skin/ type=text/css? !DOCTYPE window SYSTEM chrome://zviewer/locale/zviewer.titles.dtd !-- Window as main container-- window id=zvwindow title=Zv VideoGrid xmlns:html=http://www.w3.org/1999/xhtml; xmlns=http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul; zv_minimal_toolbar=true !-- Strings used on this page -- stringbundleset id=videogridbundle stringbundle id=messages src=chrome://zviewer/locale/videogridmessages.properties/ /stringbundleset !-- HTML Favicons work with XUL as long as you include the html: prefix -- html:link rel=icon type=image/png href=chrome://zvart/content/videogrid/icon.png / !-- Script inclusion -- script type=application/x-javascript src=chrome://zvlib/content/zvpage.js/ script type=application/x-javascript src=chrome://zvlib/content/zvwidgetdefs.js/ script type=application/x-javascript src=chrome://zvlib/content/zvutils.js/ script type=application/x-javascript src=tools.js/ script type=application/x-javascript src=views.js/ script type=application/x-javascript src=videogrid.js/ script type=application/x-javascript src=videogridwidgets.js/ script type=application/x-javascript src=indicators.js/ script type=application/x-javascript src=../common/ui_utils.js/ !-- GL UI root -- groot id=zv_groot How do I go about accessing these objects? I have tried require 'firewatir' include FireWatir ff=Firefox.new elems=ff.elements_by_xpath(//zvwindow) elems=ff.elements_by_xpath(//window) I feel like I'm missing some basic information. I also noticed this in some example code: //*[name()='vgtile' and @label='hulu'] Why is it name() and @label and not @name and label()? Is name a function? Where is it defined? Is label an attribute? Isn't name an attribute also? Andin some places I see // and in others I see //* . Is the * required or not? ADVthanksANCE for any help/pointers/etc. Jeremy Mordkoff Director, QA, IT Release ZeeVee, Inc. One Monarch Drive | Littleton, MA 01460 Office: 978.467.1395 x233 | Fax: 978.467.1404 Mobile: 978-257-2183 j...@zeevee.com mailto:j...@zeevee.com www.zeevee.com http://www.zeevee.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: Error in handling popup
Thanks sir, the error which i was getting was removed but the script does not handle popups, so please suggest me a script for handling popups. On Apr 8, 8:03 pm, Jim Matthews jim_m...@swbell.net wrote: spike, The only thing I see right off is that you have: wsh WIN32OLE.new('Wscript.Shell') My guess is that it should be: wsh = WIN32OLE.new('Wscript.Shell') That would seem to fit with the error you are getting: NoMethodError: undefined method `wsh' for #Manageresources: 0x2b8c4bc Jim On Apr 8, 7:26 am, spike vinaykumarl...@gmail.com wrote: Hi I'm woking on windows platform and IE7 using WATIR I've used the following code for handling JavaScript popup require 'win32ole' wsh WIN32OLE.new('Wscript.Shell') wsh.AppActivate('Windows Internet Explorer') wsh.Sendkeys('{ENTER}') but its not working i'm getting the following error. 1) Error: test_manage_resources(Manageresources): NoMethodError: undefined method `wsh' for #Manageresources:0x2b8c4bc manageresource.rb:24:in `test_manage_resources' Please Please please... give a solution to my problem i'm stuck with handling popup from past 2 days.. thankingyou- 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: Error in handling popup
Hi Thnaks for the reply but it isnt working for me. On Apr 8, 9:24 pm, George george.sand...@gmail.com wrote: I grabbed this code from somebody here...this may work (you'll need to install AutoIt): # Create a file clicker.rb require 'win32ole' begin autoit = WIN32OLE.new('AutoItX3.Control') loop do autoit.ControlClick(Windows Internet Explorer, '', 'OK') autoit.ControlClick(Security Information,'', 'Yes') autoit.ControlClick(Security Alert,'', 'Yes') sleep(5) end rescue Exception = e puts e end # create another file called clicker_process.rb require 'watir' require 'win32/process' @pid = Process.create( :app_name = 'ruby clicker.rb', #assuming you make the above script into a file called clicker.rb :creation_flags = Process::DETACHED_PROCESS ).process_id at_exit{ Process.kill(9,@pid) } # ...and here's your main script (delete.rb) require 'watir' require 'win32/process' require 'clicker_process' $ie = Watir::IE.attach(:title, /Your Website Title/) $ie.link(:text, Delete).click # this will trigger a popup window = This should automatically handle popups. You can also expand the list to include other window title aside from 'Windows Internet Explorer', 'Security Information' and 'Security Alert'. Hope this helps! -George On Apr 8, 5:26 am, spike vinaykumarl...@gmail.com wrote: Hi I'm woking on windows platform and IE7 using WATIR I've used the following code for handling JavaScript popup require 'win32ole' wsh WIN32OLE.new('Wscript.Shell') wsh.AppActivate('Windows Internet Explorer') wsh.Sendkeys('{ENTER}') but its not working i'm getting the following error. 1) Error: test_manage_resources(Manageresources): NoMethodError: undefined method `wsh' for #Manageresources:0x2b8c4bc manageresource.rb:24:in `test_manage_resources' Please Please please... give a solution to my problem i'm stuck with handling popup from past 2 days.. thankingyou- 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: Error in handling popup
hi, handle the popup window using autoit. install autoit software. and use the followinf code autoit = WIN32OLE.new('AutoItX3.Control') Opt(WinTitleMatchMode, 3) autoit.WinWait('Windows Internet Explorer', '', 2) autoit.WinActivate('Windows Internet Explorer') autoit.Send('{enter}') This will work fine with out any issue Regards, Kiran Y On Wed, Apr 8, 2009 at 5:56 PM, spike vinaykumarl...@gmail.com wrote: Hi I'm woking on windows platform and IE7 using WATIR I've used the following code for handling JavaScript popup require 'win32ole' wsh WIN32OLE.new('Wscript.Shell') wsh.AppActivate('Windows Internet Explorer') wsh.Sendkeys('{ENTER}') but its not working i'm getting the following error. 1) Error: test_manage_resources(Manageresources): NoMethodError: undefined method `wsh' for #Manageresources:0x2b8c4bc manageresource.rb:24:in `test_manage_resources' Please Please please... give a solution to my problem i'm stuck with handling popup from past 2 days.. thankingyou --~--~-~--~~~---~--~~ 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: Error in handling popup
Hi thanks for the reply, i've installed autoIT-v3 software but its not working. On Apr 9, 8:40 am, kiran yajamanyam kiranyajaman...@gmail.com wrote: hi, handle the popup window using autoit. install autoit software. and use the followinf code autoit = WIN32OLE.new('AutoItX3.Control') Opt(WinTitleMatchMode, 3) autoit.WinWait('Windows Internet Explorer', '', 2) autoit.WinActivate('Windows Internet Explorer') autoit.Send('{enter}') This will work fine with out any issue Regards, Kiran Y On Wed, Apr 8, 2009 at 5:56 PM, spike vinaykumarl...@gmail.com wrote: Hi I'm woking on windows platform and IE7 using WATIR I've used the following code for handling JavaScript popup require 'win32ole' wsh WIN32OLE.new('Wscript.Shell') wsh.AppActivate('Windows Internet Explorer') wsh.Sendkeys('{ENTER}') but its not working i'm getting the following error. 1) Error: test_manage_resources(Manageresources): NoMethodError: undefined method `wsh' for #Manageresources:0x2b8c4bc manageresource.rb:24:in `test_manage_resources' Please Please please... give a solution to my problem i'm stuck with handling popup from past 2 days.. thankingyou- 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: Error in handling popup
I used this code but i'm getting the following error 1) Error: test_manage_resources(Manageresources): NoMethodError: undefined method `Opt' for #Manageresources:0x2b697c8 manageresource.rb:25:in `test_manage_resources' so please suggest some solution... On Apr 9, 8:40 am, kiran yajamanyam kiranyajaman...@gmail.com wrote: hi, handle the popup window using autoit. install autoit software. and use the followinf code autoit = WIN32OLE.new('AutoItX3.Control') Opt(WinTitleMatchMode, 3) autoit.WinWait('Windows Internet Explorer', '', 2) autoit.WinActivate('Windows Internet Explorer') autoit.Send('{enter}') This will work fine with out any issue Regards, Kiran Y On Wed, Apr 8, 2009 at 5:56 PM, spike vinaykumarl...@gmail.com wrote: Hi I'm woking on windows platform and IE7 using WATIR I've used the following code for handling JavaScript popup require 'win32ole' wsh WIN32OLE.new('Wscript.Shell') wsh.AppActivate('Windows Internet Explorer') wsh.Sendkeys('{ENTER}') but its not working i'm getting the following error. 1) Error: test_manage_resources(Manageresources): NoMethodError: undefined method `wsh' for #Manageresources:0x2b8c4bc manageresource.rb:24:in `test_manage_resources' Please Please please... give a solution to my problem i'm stuck with handling popup from past 2 days.. thankingyou- 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] Handling popups using watir
Hi Can somebody please help me with handling popups using Watir i'm stuck with this. I tried many suggestions but it didnt help me. I'm working on Windows XP and Internet Explorer 7. somebody suggested me to install autoIt for handling popups so i've installed autoIT-v3 also. please please.. help me to handle popups like file download and javascript thankingyou --~--~-~--~~~---~--~~ 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: Error in handling popup
missed this piece of code require 'win32ole' still if it wont work just comment out Opt(WinTitleMatchMode, 3) code and try. If still it wont work please send me the scenario u are testing i will try and give u the code. Regards, Kiran Y On Thu, Apr 9, 2009 at 9:26 AM, spike vinaykumarl...@gmail.com wrote: I used this code but i'm getting the following error 1) Error: test_manage_resources(Manageresources): NoMethodError: undefined method `Opt' for #Manageresources:0x2b697c8 manageresource.rb:25:in `test_manage_resources' so please suggest some solution... On Apr 9, 8:40 am, kiran yajamanyam kiranyajaman...@gmail.com wrote: hi, handle the popup window using autoit. install autoit software. and use the followinf code autoit = WIN32OLE.new('AutoItX3.Control') Opt(WinTitleMatchMode, 3) autoit.WinWait('Windows Internet Explorer', '', 2) autoit.WinActivate('Windows Internet Explorer') autoit.Send('{enter}') This will work fine with out any issue Regards, Kiran Y On Wed, Apr 8, 2009 at 5:56 PM, spike vinaykumarl...@gmail.com wrote: Hi I'm woking on windows platform and IE7 using WATIR I've used the following code for handling JavaScript popup require 'win32ole' wsh WIN32OLE.new('Wscript.Shell') wsh.AppActivate('Windows Internet Explorer') wsh.Sendkeys('{ENTER}') but its not working i'm getting the following error. 1) Error: test_manage_resources(Manageresources): NoMethodError: undefined method `wsh' for #Manageresources:0x2b8c4bc manageresource.rb:24:in `test_manage_resources' Please Please please... give a solution to my problem i'm stuck with handling popup from past 2 days.. thankingyou- 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: Error in handling popup
Ya it still didnt work for me Test Scenario I'm running on windows platform with IE7 I've to upload a file to the application i'm testing. to do that i'm login to the application and navigating to the respective page where i've to upload the file. I'm able to upload the file, upon successfully uploading the fiel a POPUP appears with the msg FILE UPLOADED SUCCESSFULLY and it has a button OK which has to clicked for the popup to disappear. i'm stuck here. the code is not clicking the OK button. following is the script i'm running. require 'Watir' require 'test/unit' class Manageresources Test::Unit::TestCase def test_manage_resources ie = Watir::IE.start http://192.168.25.10:215/; ie.maximize() ie.text_field(:name, Login1$UserName).set(vinay) ie.text_field(:name, Login1$Password).set(welcome) ie.checkbox(:name, Login1$RememberMe).click ie.button(:value, Log In).click ie.link(:href, http://192.168.25.10:215/administrator/ Default.aspx).click ie.link(:href, javascript:__doPostBack ('ctl00$Menu1','Resources')).click ie.link(:href, http://192.168.25.10:215/admin/ ManageResources.aspx).click ie.link(:id, ctl00_ContentPlaceHolder1_lnkAdd).click ie.radio(:id, ctl00_ContentPlaceHolder1_rdCourses_1).click ie.button(:id, ctl00_ContentPlaceHolder1_btnNext).click ie.file_field(:id, ctl00_ContentPlaceHolder1_Uploadfile).set(D:\ \BCSBI.zip) ie.file_field(:id, ctl00_ContentPlaceHolder1_btnUpload).click # For handling popups require 'win32ole' autoit = WIN32OLE.new('AutoItX3.Control') # Opt(WinTitleMatchMode, 3) autoit.WinWait('Windows Internet Explorer', '', 2) autoit.WinActivate('Windows Internet Explorer') autoit.Send('{~}') if ie.radio(:id, ctl00_ContentPlaceHolder1_RdlistisFeedback_1).isSet? puts IS FEEDBACK option Yes is selected else ie.radio(:id, ctl00_ContentPlaceHolder1_RdlistisFeedback_1).click end ie.select_list(:id, ctl00_ContentPlaceHolder1_DdlAccesstype).set (Public) ie.select_list(:id, ctl00_ContentPlaceHolder1_DdlApprovaltype).set(Admin) end end Please suggest me a solution thankingyou On Apr 9, 9:24 am, kiran yajamanyam kiranyajaman...@gmail.com wrote: missed this piece of code require 'win32ole' still if it wont work just comment out Opt(WinTitleMatchMode, 3) code and try. If still it wont work please send me the scenario u are testing i will try and give u the code. Regards, Kiran Y On Thu, Apr 9, 2009 at 9:26 AM, spike vinaykumarl...@gmail.com wrote: I used this code but i'm getting the following error 1) Error: test_manage_resources(Manageresources): NoMethodError: undefined method `Opt' for #Manageresources:0x2b697c8 manageresource.rb:25:in `test_manage_resources' so please suggest some solution... On Apr 9, 8:40 am, kiran yajamanyam kiranyajaman...@gmail.com wrote: hi, handle the popup window using autoit. install autoit software. and use the followinf code autoit = WIN32OLE.new('AutoItX3.Control') Opt(WinTitleMatchMode, 3) autoit.WinWait('Windows Internet Explorer', '', 2) autoit.WinActivate('Windows Internet Explorer') autoit.Send('{enter}') This will work fine with out any issue Regards, Kiran Y On Wed, Apr 8, 2009 at 5:56 PM, spike vinaykumarl...@gmail.com wrote: Hi I'm woking on windows platform and IE7 using WATIR I've used the following code for handling JavaScript popup require 'win32ole' wsh WIN32OLE.new('Wscript.Shell') wsh.AppActivate('Windows Internet Explorer') wsh.Sendkeys('{ENTER}') but its not working i'm getting the following error. 1) Error: test_manage_resources(Manageresources): NoMethodError: undefined method `wsh' for #Manageresources:0x2b8c4bc manageresource.rb:24:in `test_manage_resources' Please Please please... give a solution to my problem i'm stuck with handling popup from past 2 days.. thankingyou- 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 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: Handling popups using watir
Didn't you just make a thread about this? On Apr 8, 9:23 pm, spike vinaykumarl...@gmail.com wrote: Hi Can somebody please help me with handling popups using Watir i'm stuck with this. I tried many suggestions but it didnt help me. I'm working on Windows XP and Internet Explorer 7. somebody suggested me to install autoIt for handling popups so i've installed autoIT-v3 also. please please.. help me to handle popups like file download and javascript thankingyou --~--~-~--~~~---~--~~ 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: Error in handling popup
You have to give the exact caption of the window which is appearing as popup. In your case that caption of the pop up is FILE UPLOADED SUCCESSFULLY try this code: autoit = WIN32OLE.new('AutoItX3.Control') Opt(WinTitleMatchMode, 3) autoit.WinWait('FILE UPLOADED SUCCESSFULLY', '', 2) autoit.WinActivate('FILE UPLOADED SUCCESSFULLY') autoit.Send('{enter}') if you are online in g-talk you can ping me. Regards, Kiran Y kiranyajaman...@gmail.com On Thu, Apr 9, 2009 at 11:02 AM, spike vinaykumarl...@gmail.com wrote: Ya it still didnt work for me Test Scenario I'm running on windows platform with IE7 I've to upload a file to the application i'm testing. to do that i'm login to the application and navigating to the respective page where i've to upload the file. I'm able to upload the file, upon successfully uploading the fiel a POPUP appears with the msg FILE UPLOADED SUCCESSFULLY and it has a button OK which has to clicked for the popup to disappear. i'm stuck here. the code is not clicking the OK button. following is the script i'm running. require 'Watir' require 'test/unit' class Manageresources Test::Unit::TestCase def test_manage_resources ie = Watir::IE.start http://192.168.25.10:215/; ie.maximize() ie.text_field(:name, Login1$UserName).set(vinay) ie.text_field(:name, Login1$Password).set(welcome) ie.checkbox(:name, Login1$RememberMe).click ie.button(:value, Log In).click ie.link(:href, http://192.168.25.10:215/administrator/ Default.aspx).click ie.link(:href, javascript:__doPostBack ('ctl00$Menu1','Resources')).click ie.link(:href, http://192.168.25.10:215/admin/ ManageResources.aspx).click ie.link(:id, ctl00_ContentPlaceHolder1_lnkAdd).click ie.radio(:id, ctl00_ContentPlaceHolder1_rdCourses_1).click ie.button(:id, ctl00_ContentPlaceHolder1_btnNext).click ie.file_field(:id, ctl00_ContentPlaceHolder1_Uploadfile).set(D:\ \BCSBI.zip) ie.file_field(:id, ctl00_ContentPlaceHolder1_btnUpload).click # For handling popups require 'win32ole' autoit = WIN32OLE.new('AutoItX3.Control') # Opt(WinTitleMatchMode, 3) autoit.WinWait('Windows Internet Explorer', '', 2) autoit.WinActivate('Windows Internet Explorer') autoit.Send('{~}') if ie.radio(:id, ctl00_ContentPlaceHolder1_RdlistisFeedback_1).isSet? puts IS FEEDBACK option Yes is selected else ie.radio(:id, ctl00_ContentPlaceHolder1_RdlistisFeedback_1).click end ie.select_list(:id, ctl00_ContentPlaceHolder1_DdlAccesstype).set (Public) ie.select_list(:id, ctl00_ContentPlaceHolder1_DdlApprovaltype).set(Admin) end end Please suggest me a solution thankingyou On Apr 9, 9:24 am, kiran yajamanyam kiranyajaman...@gmail.com wrote: missed this piece of code require 'win32ole' still if it wont work just comment out Opt(WinTitleMatchMode, 3) code and try. If still it wont work please send me the scenario u are testing i will try and give u the code. Regards, Kiran Y On Thu, Apr 9, 2009 at 9:26 AM, spike vinaykumarl...@gmail.com wrote: I used this code but i'm getting the following error 1) Error: test_manage_resources(Manageresources): NoMethodError: undefined method `Opt' for #Manageresources:0x2b697c8 manageresource.rb:25:in `test_manage_resources' so please suggest some solution... On Apr 9, 8:40 am, kiran yajamanyam kiranyajaman...@gmail.com wrote: hi, handle the popup window using autoit. install autoit software. and use the followinf code autoit = WIN32OLE.new('AutoItX3.Control') Opt(WinTitleMatchMode, 3) autoit.WinWait('Windows Internet Explorer', '', 2) autoit.WinActivate('Windows Internet Explorer') autoit.Send('{enter}') This will work fine with out any issue Regards, Kiran Y On Wed, Apr 8, 2009 at 5:56 PM, spike vinaykumarl...@gmail.com wrote: Hi I'm woking on windows platform and IE7 using WATIR I've used the following code for handling JavaScript popup require 'win32ole' wsh WIN32OLE.new('Wscript.Shell') wsh.AppActivate('Windows Internet Explorer') wsh.Sendkeys('{ENTER}') but its not working i'm getting the following error. 1) Error: test_manage_resources(Manageresources): NoMethodError: undefined method `wsh' for #Manageresources:0x2b8c4bc manageresource.rb:24:in `test_manage_resources' Please Please please... give a solution to my problem i'm stuck with handling popup from past 2 days.. thankingyou- 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 watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group,
[wtr-general] Re: Error in handling popup
if i'm clicking the OK button manually its going further to do rest of the operations or els its hung with the popup On Apr 9, 10:38 am, kiran yajamanyam kiranyajaman...@gmail.com wrote: You have to give the exact caption of the window which is appearing as popup. In your case that caption of the pop up is FILE UPLOADED SUCCESSFULLY try this code: autoit = WIN32OLE.new('AutoItX3.Control') Opt(WinTitleMatchMode, 3) autoit.WinWait('FILE UPLOADED SUCCESSFULLY', '', 2) autoit.WinActivate('FILE UPLOADED SUCCESSFULLY') autoit.Send('{enter}') if you are online in g-talk you can ping me. Regards, Kiran Y kiranyajaman...@gmail.com On Thu, Apr 9, 2009 at 11:02 AM, spike vinaykumarl...@gmail.com wrote: Ya it still didnt work for me Test Scenario I'm running on windows platform with IE7 I've to upload a file to the application i'm testing. to do that i'm login to the application and navigating to the respective page where i've to upload the file. I'm able to upload the file, upon successfully uploading the fiel a POPUP appears with the msg FILE UPLOADED SUCCESSFULLY and it has a button OK which has to clicked for the popup to disappear. i'm stuck here. the code is not clicking the OK button. following is the script i'm running. require 'Watir' require 'test/unit' class Manageresources Test::Unit::TestCase def test_manage_resources ie = Watir::IE.start http://192.168.25.10:215/; ie.maximize() ie.text_field(:name, Login1$UserName).set(vinay) ie.text_field(:name, Login1$Password).set(welcome) ie.checkbox(:name, Login1$RememberMe).click ie.button(:value, Log In).click ie.link(:href, http://192.168.25.10:215/administrator/ Default.aspx).click ie.link(:href, javascript:__doPostBack ('ctl00$Menu1','Resources')).click ie.link(:href, http://192.168.25.10:215/admin/ ManageResources.aspx).click ie.link(:id, ctl00_ContentPlaceHolder1_lnkAdd).click ie.radio(:id, ctl00_ContentPlaceHolder1_rdCourses_1).click ie.button(:id, ctl00_ContentPlaceHolder1_btnNext).click ie.file_field(:id, ctl00_ContentPlaceHolder1_Uploadfile).set(D:\ \BCSBI.zip) ie.file_field(:id, ctl00_ContentPlaceHolder1_btnUpload).click # For handling popups require 'win32ole' autoit = WIN32OLE.new('AutoItX3.Control') # Opt(WinTitleMatchMode, 3) autoit.WinWait('Windows Internet Explorer', '', 2) autoit.WinActivate('Windows Internet Explorer') autoit.Send('{~}') if ie.radio(:id, ctl00_ContentPlaceHolder1_RdlistisFeedback_1).isSet? puts IS FEEDBACK option Yes is selected else ie.radio(:id, ctl00_ContentPlaceHolder1_RdlistisFeedback_1).click end ie.select_list(:id, ctl00_ContentPlaceHolder1_DdlAccesstype).set (Public) ie.select_list(:id, ctl00_ContentPlaceHolder1_DdlApprovaltype).set(Admin) end end Please suggest me a solution thankingyou On Apr 9, 9:24 am, kiran yajamanyam kiranyajaman...@gmail.com wrote: missed this piece of code require 'win32ole' still if it wont work just comment out Opt(WinTitleMatchMode, 3) code and try. If still it wont work please send me the scenario u are testing i will try and give u the code. Regards, Kiran Y On Thu, Apr 9, 2009 at 9:26 AM, spike vinaykumarl...@gmail.com wrote: I used this code but i'm getting the following error 1) Error: test_manage_resources(Manageresources): NoMethodError: undefined method `Opt' for #Manageresources:0x2b697c8 manageresource.rb:25:in `test_manage_resources' so please suggest some solution... On Apr 9, 8:40 am, kiran yajamanyam kiranyajaman...@gmail.com wrote: hi, handle the popup window using autoit. install autoit software. and use the followinf code autoit = WIN32OLE.new('AutoItX3.Control') Opt(WinTitleMatchMode, 3) autoit.WinWait('Windows Internet Explorer', '', 2) autoit.WinActivate('Windows Internet Explorer') autoit.Send('{enter}') This will work fine with out any issue Regards, Kiran Y On Wed, Apr 8, 2009 at 5:56 PM, spike vinaykumarl...@gmail.com wrote: Hi I'm woking on windows platform and IE7 using WATIR I've used the following code for handling JavaScript popup require 'win32ole' wsh WIN32OLE.new('Wscript.Shell') wsh.AppActivate('Windows Internet Explorer') wsh.Sendkeys('{ENTER}') but its not working i'm getting the following error. 1) Error: test_manage_resources(Manageresources): NoMethodError: undefined method `wsh' for #Manageresources:0x2b8c4bc manageresource.rb:24:in `test_manage_resources' Please Please please... give a solution to my problem i'm stuck with handling popup from past 2 days.. thankingyou- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text -
[wtr-general] Re: Error in handling popup
make sure that ur caption is same (Including caps) and if autoit.Send({'enter'}) is not working try with autoit.Send({'space'}) On Thu, Apr 9, 2009 at 11:10 AM, spike vinaykumarl...@gmail.com wrote: if i'm clicking the OK button manually its going further to do rest of the operations or els its hung with the popup On Apr 9, 10:38 am, kiran yajamanyam kiranyajaman...@gmail.com wrote: You have to give the exact caption of the window which is appearing as popup. In your case that caption of the pop up is FILE UPLOADED SUCCESSFULLY try this code: autoit = WIN32OLE.new('AutoItX3.Control') Opt(WinTitleMatchMode, 3) autoit.WinWait('FILE UPLOADED SUCCESSFULLY', '', 2) autoit.WinActivate('FILE UPLOADED SUCCESSFULLY') autoit.Send('{enter}') if you are online in g-talk you can ping me. Regards, Kiran Y kiranyajaman...@gmail.com On Thu, Apr 9, 2009 at 11:02 AM, spike vinaykumarl...@gmail.com wrote: Ya it still didnt work for me Test Scenario I'm running on windows platform with IE7 I've to upload a file to the application i'm testing. to do that i'm login to the application and navigating to the respective page where i've to upload the file. I'm able to upload the file, upon successfully uploading the fiel a POPUP appears with the msg FILE UPLOADED SUCCESSFULLY and it has a button OK which has to clicked for the popup to disappear. i'm stuck here. the code is not clicking the OK button. following is the script i'm running. require 'Watir' require 'test/unit' class Manageresources Test::Unit::TestCase def test_manage_resources ie = Watir::IE.start http://192.168.25.10:215/; ie.maximize() ie.text_field(:name, Login1$UserName).set(vinay) ie.text_field(:name, Login1$Password).set(welcome) ie.checkbox(:name, Login1$RememberMe).click ie.button(:value, Log In).click ie.link(:href, http://192.168.25.10:215/administrator/ Default.aspx).click ie.link(:href, javascript:__doPostBack ('ctl00$Menu1','Resources')).click ie.link(:href, http://192.168.25.10:215/admin/ ManageResources.aspx).click ie.link(:id, ctl00_ContentPlaceHolder1_lnkAdd).click ie.radio(:id, ctl00_ContentPlaceHolder1_rdCourses_1).click ie.button(:id, ctl00_ContentPlaceHolder1_btnNext).click ie.file_field(:id, ctl00_ContentPlaceHolder1_Uploadfile).set(D:\ \BCSBI.zip) ie.file_field(:id, ctl00_ContentPlaceHolder1_btnUpload).click # For handling popups require 'win32ole' autoit = WIN32OLE.new('AutoItX3.Control') # Opt(WinTitleMatchMode, 3) autoit.WinWait('Windows Internet Explorer', '', 2) autoit.WinActivate('Windows Internet Explorer') autoit.Send('{~}') if ie.radio(:id, ctl00_ContentPlaceHolder1_RdlistisFeedback_1).isSet? puts IS FEEDBACK option Yes is selected else ie.radio(:id, ctl00_ContentPlaceHolder1_RdlistisFeedback_1).click end ie.select_list(:id, ctl00_ContentPlaceHolder1_DdlAccesstype).set (Public) ie.select_list(:id, ctl00_ContentPlaceHolder1_DdlApprovaltype).set(Admin) end end Please suggest me a solution thankingyou On Apr 9, 9:24 am, kiran yajamanyam kiranyajaman...@gmail.com wrote: missed this piece of code require 'win32ole' still if it wont work just comment out Opt(WinTitleMatchMode, 3) code and try. If still it wont work please send me the scenario u are testing i will try and give u the code. Regards, Kiran Y On Thu, Apr 9, 2009 at 9:26 AM, spike vinaykumarl...@gmail.com wrote: I used this code but i'm getting the following error 1) Error: test_manage_resources(Manageresources): NoMethodError: undefined method `Opt' for #Manageresources:0x2b697c8 manageresource.rb:25:in `test_manage_resources' so please suggest some solution... On Apr 9, 8:40 am, kiran yajamanyam kiranyajaman...@gmail.com wrote: hi, handle the popup window using autoit. install autoit software. and use the followinf code autoit = WIN32OLE.new('AutoItX3.Control') Opt(WinTitleMatchMode, 3) autoit.WinWait('Windows Internet Explorer', '', 2) autoit.WinActivate('Windows Internet Explorer') autoit.Send('{enter}') This will work fine with out any issue Regards, Kiran Y On Wed, Apr 8, 2009 at 5:56 PM, spike vinaykumarl...@gmail.com wrote: Hi I'm woking on windows platform and IE7 using WATIR I've used the following code for handling JavaScript popup require 'win32ole' wsh WIN32OLE.new('Wscript.Shell') wsh.AppActivate('Windows Internet Explorer') wsh.Sendkeys('{ENTER}') but its not working i'm getting the following error. 1) Error: test_manage_resources(Manageresources): NoMethodError: undefined method `wsh' for #Manageresources:0x2b8c4bc
[wtr-general] Re: Error in handling popup
i didnt get u the popup window title is Windows Internet Explorer and the msg displayed in it is File Uploaded Successfully which one should i use inthe code.. On Apr 9, 10:38 am, kiran yajamanyam kiranyajaman...@gmail.com wrote: You have to give the exact caption of the window which is appearing as popup. In your case that caption of the pop up is FILE UPLOADED SUCCESSFULLY try this code: autoit = WIN32OLE.new('AutoItX3.Control') Opt(WinTitleMatchMode, 3) autoit.WinWait('FILE UPLOADED SUCCESSFULLY', '', 2) autoit.WinActivate('FILE UPLOADED SUCCESSFULLY') autoit.Send('{enter}') if you are online in g-talk you can ping me. Regards, Kiran Y kiranyajaman...@gmail.com On Thu, Apr 9, 2009 at 11:02 AM, spike vinaykumarl...@gmail.com wrote: Ya it still didnt work for me Test Scenario I'm running on windows platform with IE7 I've to upload a file to the application i'm testing. to do that i'm login to the application and navigating to the respective page where i've to upload the file. I'm able to upload the file, upon successfully uploading the fiel a POPUP appears with the msg FILE UPLOADED SUCCESSFULLY and it has a button OK which has to clicked for the popup to disappear. i'm stuck here. the code is not clicking the OK button. following is the script i'm running. require 'Watir' require 'test/unit' class Manageresources Test::Unit::TestCase def test_manage_resources ie = Watir::IE.start http://192.168.25.10:215/; ie.maximize() ie.text_field(:name, Login1$UserName).set(vinay) ie.text_field(:name, Login1$Password).set(welcome) ie.checkbox(:name, Login1$RememberMe).click ie.button(:value, Log In).click ie.link(:href, http://192.168.25.10:215/administrator/ Default.aspx).click ie.link(:href, javascript:__doPostBack ('ctl00$Menu1','Resources')).click ie.link(:href, http://192.168.25.10:215/admin/ ManageResources.aspx).click ie.link(:id, ctl00_ContentPlaceHolder1_lnkAdd).click ie.radio(:id, ctl00_ContentPlaceHolder1_rdCourses_1).click ie.button(:id, ctl00_ContentPlaceHolder1_btnNext).click ie.file_field(:id, ctl00_ContentPlaceHolder1_Uploadfile).set(D:\ \BCSBI.zip) ie.file_field(:id, ctl00_ContentPlaceHolder1_btnUpload).click # For handling popups require 'win32ole' autoit = WIN32OLE.new('AutoItX3.Control') # Opt(WinTitleMatchMode, 3) autoit.WinWait('Windows Internet Explorer', '', 2) autoit.WinActivate('Windows Internet Explorer') autoit.Send('{~}') if ie.radio(:id, ctl00_ContentPlaceHolder1_RdlistisFeedback_1).isSet? puts IS FEEDBACK option Yes is selected else ie.radio(:id, ctl00_ContentPlaceHolder1_RdlistisFeedback_1).click end ie.select_list(:id, ctl00_ContentPlaceHolder1_DdlAccesstype).set (Public) ie.select_list(:id, ctl00_ContentPlaceHolder1_DdlApprovaltype).set(Admin) end end Please suggest me a solution thankingyou On Apr 9, 9:24 am, kiran yajamanyam kiranyajaman...@gmail.com wrote: missed this piece of code require 'win32ole' still if it wont work just comment out Opt(WinTitleMatchMode, 3) code and try. If still it wont work please send me the scenario u are testing i will try and give u the code. Regards, Kiran Y On Thu, Apr 9, 2009 at 9:26 AM, spike vinaykumarl...@gmail.com wrote: I used this code but i'm getting the following error 1) Error: test_manage_resources(Manageresources): NoMethodError: undefined method `Opt' for #Manageresources:0x2b697c8 manageresource.rb:25:in `test_manage_resources' so please suggest some solution... On Apr 9, 8:40 am, kiran yajamanyam kiranyajaman...@gmail.com wrote: hi, handle the popup window using autoit. install autoit software. and use the followinf code autoit = WIN32OLE.new('AutoItX3.Control') Opt(WinTitleMatchMode, 3) autoit.WinWait('Windows Internet Explorer', '', 2) autoit.WinActivate('Windows Internet Explorer') autoit.Send('{enter}') This will work fine with out any issue Regards, Kiran Y On Wed, Apr 8, 2009 at 5:56 PM, spike vinaykumarl...@gmail.com wrote: Hi I'm woking on windows platform and IE7 using WATIR I've used the following code for handling JavaScript popup require 'win32ole' wsh WIN32OLE.new('Wscript.Shell') wsh.AppActivate('Windows Internet Explorer') wsh.Sendkeys('{ENTER}') but its not working i'm getting the following error. 1) Error: test_manage_resources(Manageresources): NoMethodError: undefined method `wsh' for #Manageresources:0x2b8c4bc manageresource.rb:24:in `test_manage_resources' Please Please please... give a solution to my problem i'm stuck with handling popup from past 2 days.. thankingyou- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted
[wtr-general] Re: Error in handling popup
sorry chat is disabled in my company... On Apr 9, 10:38 am, kiran yajamanyam kiranyajaman...@gmail.com wrote: You have to give the exact caption of the window which is appearing as popup. In your case that caption of the pop up is FILE UPLOADED SUCCESSFULLY try this code: autoit = WIN32OLE.new('AutoItX3.Control') Opt(WinTitleMatchMode, 3) autoit.WinWait('FILE UPLOADED SUCCESSFULLY', '', 2) autoit.WinActivate('FILE UPLOADED SUCCESSFULLY') autoit.Send('{enter}') if you are online in g-talk you can ping me. Regards, Kiran Y kiranyajaman...@gmail.com On Thu, Apr 9, 2009 at 11:02 AM, spike vinaykumarl...@gmail.com wrote: Ya it still didnt work for me Test Scenario I'm running on windows platform with IE7 I've to upload a file to the application i'm testing. to do that i'm login to the application and navigating to the respective page where i've to upload the file. I'm able to upload the file, upon successfully uploading the fiel a POPUP appears with the msg FILE UPLOADED SUCCESSFULLY and it has a button OK which has to clicked for the popup to disappear. i'm stuck here. the code is not clicking the OK button. following is the script i'm running. require 'Watir' require 'test/unit' class Manageresources Test::Unit::TestCase def test_manage_resources ie = Watir::IE.start http://192.168.25.10:215/; ie.maximize() ie.text_field(:name, Login1$UserName).set(vinay) ie.text_field(:name, Login1$Password).set(welcome) ie.checkbox(:name, Login1$RememberMe).click ie.button(:value, Log In).click ie.link(:href, http://192.168.25.10:215/administrator/ Default.aspx).click ie.link(:href, javascript:__doPostBack ('ctl00$Menu1','Resources')).click ie.link(:href, http://192.168.25.10:215/admin/ ManageResources.aspx).click ie.link(:id, ctl00_ContentPlaceHolder1_lnkAdd).click ie.radio(:id, ctl00_ContentPlaceHolder1_rdCourses_1).click ie.button(:id, ctl00_ContentPlaceHolder1_btnNext).click ie.file_field(:id, ctl00_ContentPlaceHolder1_Uploadfile).set(D:\ \BCSBI.zip) ie.file_field(:id, ctl00_ContentPlaceHolder1_btnUpload).click # For handling popups require 'win32ole' autoit = WIN32OLE.new('AutoItX3.Control') # Opt(WinTitleMatchMode, 3) autoit.WinWait('Windows Internet Explorer', '', 2) autoit.WinActivate('Windows Internet Explorer') autoit.Send('{~}') if ie.radio(:id, ctl00_ContentPlaceHolder1_RdlistisFeedback_1).isSet? puts IS FEEDBACK option Yes is selected else ie.radio(:id, ctl00_ContentPlaceHolder1_RdlistisFeedback_1).click end ie.select_list(:id, ctl00_ContentPlaceHolder1_DdlAccesstype).set (Public) ie.select_list(:id, ctl00_ContentPlaceHolder1_DdlApprovaltype).set(Admin) end end Please suggest me a solution thankingyou On Apr 9, 9:24 am, kiran yajamanyam kiranyajaman...@gmail.com wrote: missed this piece of code require 'win32ole' still if it wont work just comment out Opt(WinTitleMatchMode, 3) code and try. If still it wont work please send me the scenario u are testing i will try and give u the code. Regards, Kiran Y On Thu, Apr 9, 2009 at 9:26 AM, spike vinaykumarl...@gmail.com wrote: I used this code but i'm getting the following error 1) Error: test_manage_resources(Manageresources): NoMethodError: undefined method `Opt' for #Manageresources:0x2b697c8 manageresource.rb:25:in `test_manage_resources' so please suggest some solution... On Apr 9, 8:40 am, kiran yajamanyam kiranyajaman...@gmail.com wrote: hi, handle the popup window using autoit. install autoit software. and use the followinf code autoit = WIN32OLE.new('AutoItX3.Control') Opt(WinTitleMatchMode, 3) autoit.WinWait('Windows Internet Explorer', '', 2) autoit.WinActivate('Windows Internet Explorer') autoit.Send('{enter}') This will work fine with out any issue Regards, Kiran Y On Wed, Apr 8, 2009 at 5:56 PM, spike vinaykumarl...@gmail.com wrote: Hi I'm woking on windows platform and IE7 using WATIR I've used the following code for handling JavaScript popup require 'win32ole' wsh WIN32OLE.new('Wscript.Shell') wsh.AppActivate('Windows Internet Explorer') wsh.Sendkeys('{ENTER}') but its not working i'm getting the following error. 1) Error: test_manage_resources(Manageresources): NoMethodError: undefined method `wsh' for #Manageresources:0x2b8c4bc manageresource.rb:24:in `test_manage_resources' Please Please please... give a solution to my problem i'm stuck with handling popup from past 2 days.. thankingyou- 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
[wtr-general] Re: Error in handling popup
You should use the caption only. Means Windows Internet Explorer only. Use space than enter On Thu, Apr 9, 2009 at 11:16 AM, spike vinaykumarl...@gmail.com wrote: i didnt get u the popup window title is Windows Internet Explorer and the msg displayed in it is File Uploaded Successfully which one should i use inthe code.. On Apr 9, 10:38 am, kiran yajamanyam kiranyajaman...@gmail.com wrote: You have to give the exact caption of the window which is appearing as popup. In your case that caption of the pop up is FILE UPLOADED SUCCESSFULLY try this code: autoit = WIN32OLE.new('AutoItX3.Control') Opt(WinTitleMatchMode, 3) autoit.WinWait('FILE UPLOADED SUCCESSFULLY', '', 2) autoit.WinActivate('FILE UPLOADED SUCCESSFULLY') autoit.Send('{enter}') if you are online in g-talk you can ping me. Regards, Kiran Y kiranyajaman...@gmail.com On Thu, Apr 9, 2009 at 11:02 AM, spike vinaykumarl...@gmail.com wrote: Ya it still didnt work for me Test Scenario I'm running on windows platform with IE7 I've to upload a file to the application i'm testing. to do that i'm login to the application and navigating to the respective page where i've to upload the file. I'm able to upload the file, upon successfully uploading the fiel a POPUP appears with the msg FILE UPLOADED SUCCESSFULLY and it has a button OK which has to clicked for the popup to disappear. i'm stuck here. the code is not clicking the OK button. following is the script i'm running. require 'Watir' require 'test/unit' class Manageresources Test::Unit::TestCase def test_manage_resources ie = Watir::IE.start http://192.168.25.10:215/; ie.maximize() ie.text_field(:name, Login1$UserName).set(vinay) ie.text_field(:name, Login1$Password).set(welcome) ie.checkbox(:name, Login1$RememberMe).click ie.button(:value, Log In).click ie.link(:href, http://192.168.25.10:215/administrator/ Default.aspx).click ie.link(:href, javascript:__doPostBack ('ctl00$Menu1','Resources')).click ie.link(:href, http://192.168.25.10:215/admin/ ManageResources.aspx).click ie.link(:id, ctl00_ContentPlaceHolder1_lnkAdd).click ie.radio(:id, ctl00_ContentPlaceHolder1_rdCourses_1).click ie.button(:id, ctl00_ContentPlaceHolder1_btnNext).click ie.file_field(:id, ctl00_ContentPlaceHolder1_Uploadfile).set(D:\ \BCSBI.zip) ie.file_field(:id, ctl00_ContentPlaceHolder1_btnUpload).click # For handling popups require 'win32ole' autoit = WIN32OLE.new('AutoItX3.Control') # Opt(WinTitleMatchMode, 3) autoit.WinWait('Windows Internet Explorer', '', 2) autoit.WinActivate('Windows Internet Explorer') autoit.Send('{~}') if ie.radio(:id, ctl00_ContentPlaceHolder1_RdlistisFeedback_1).isSet? puts IS FEEDBACK option Yes is selected else ie.radio(:id, ctl00_ContentPlaceHolder1_RdlistisFeedback_1).click end ie.select_list(:id, ctl00_ContentPlaceHolder1_DdlAccesstype).set (Public) ie.select_list(:id, ctl00_ContentPlaceHolder1_DdlApprovaltype).set(Admin) end end Please suggest me a solution thankingyou On Apr 9, 9:24 am, kiran yajamanyam kiranyajaman...@gmail.com wrote: missed this piece of code require 'win32ole' still if it wont work just comment out Opt(WinTitleMatchMode, 3) code and try. If still it wont work please send me the scenario u are testing i will try and give u the code. Regards, Kiran Y On Thu, Apr 9, 2009 at 9:26 AM, spike vinaykumarl...@gmail.com wrote: I used this code but i'm getting the following error 1) Error: test_manage_resources(Manageresources): NoMethodError: undefined method `Opt' for #Manageresources:0x2b697c8 manageresource.rb:25:in `test_manage_resources' so please suggest some solution... On Apr 9, 8:40 am, kiran yajamanyam kiranyajaman...@gmail.com wrote: hi, handle the popup window using autoit. install autoit software. and use the followinf code autoit = WIN32OLE.new('AutoItX3.Control') Opt(WinTitleMatchMode, 3) autoit.WinWait('Windows Internet Explorer', '', 2) autoit.WinActivate('Windows Internet Explorer') autoit.Send('{enter}') This will work fine with out any issue Regards, Kiran Y On Wed, Apr 8, 2009 at 5:56 PM, spike vinaykumarl...@gmail.com wrote: Hi I'm woking on windows platform and IE7 using WATIR I've used the following code for handling JavaScript popup require 'win32ole' wsh WIN32OLE.new('Wscript.Shell') wsh.AppActivate('Windows Internet Explorer') wsh.Sendkeys('{ENTER}') but its not working i'm getting the following error. 1) Error: test_manage_resources(Manageresources): NoMethodError: undefined method `wsh' for
[wtr-general] Re: Regex question
Thank you, ANu. It works. On Apr 8, 6:40 pm, ANu Gangavaram anuwri...@gmail.com wrote: When using regular expression with a variable, the syntax is /#{str}/ On Wed, Apr 8, 2009 at 9:30 PM, vladimir...@hotmail.com vladimir...@hotmail.com wrote: I have a string obj_url = http://crisp.adoc.xerox.com:8080/docushare/dsweb/Get/ Document-77/ and need to extract 77. This code works perfect: handle = /.*Document-(.*)\//.match( obj_url ) puts handle[ 1 ] # returns 77 but this code does not work: obj_type = Document str = '.*' + obj_type +'-(.*)\/' handle = /str/.match( obj_url ) Please, help. Thanks, Vladimir- 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: Error in handling popup
use space i didnt get this..one On Apr 9, 10:48 am, kiran yajamanyam kiranyajaman...@gmail.com wrote: You should use the caption only. Means Windows Internet Explorer only. Use space than enter On Thu, Apr 9, 2009 at 11:16 AM, spike vinaykumarl...@gmail.com wrote: i didnt get u the popup window title is Windows Internet Explorer and the msg displayed in it is File Uploaded Successfully which one should i use inthe code.. On Apr 9, 10:38 am, kiran yajamanyam kiranyajaman...@gmail.com wrote: You have to give the exact caption of the window which is appearing as popup. In your case that caption of the pop up is FILE UPLOADED SUCCESSFULLY try this code: autoit = WIN32OLE.new('AutoItX3.Control') Opt(WinTitleMatchMode, 3) autoit.WinWait('FILE UPLOADED SUCCESSFULLY', '', 2) autoit.WinActivate('FILE UPLOADED SUCCESSFULLY') autoit.Send('{enter}') if you are online in g-talk you can ping me. Regards, Kiran Y kiranyajaman...@gmail.com On Thu, Apr 9, 2009 at 11:02 AM, spike vinaykumarl...@gmail.com wrote: Ya it still didnt work for me Test Scenario I'm running on windows platform with IE7 I've to upload a file to the application i'm testing. to do that i'm login to the application and navigating to the respective page where i've to upload the file. I'm able to upload the file, upon successfully uploading the fiel a POPUP appears with the msg FILE UPLOADED SUCCESSFULLY and it has a button OK which has to clicked for the popup to disappear. i'm stuck here. the code is not clicking the OK button. following is the script i'm running. require 'Watir' require 'test/unit' class Manageresources Test::Unit::TestCase def test_manage_resources ie = Watir::IE.start http://192.168.25.10:215/; ie.maximize() ie.text_field(:name, Login1$UserName).set(vinay) ie.text_field(:name, Login1$Password).set(welcome) ie.checkbox(:name, Login1$RememberMe).click ie.button(:value, Log In).click ie.link(:href, http://192.168.25.10:215/administrator/ Default.aspx).click ie.link(:href, javascript:__doPostBack ('ctl00$Menu1','Resources')).click ie.link(:href, http://192.168.25.10:215/admin/ ManageResources.aspx).click ie.link(:id, ctl00_ContentPlaceHolder1_lnkAdd).click ie.radio(:id, ctl00_ContentPlaceHolder1_rdCourses_1).click ie.button(:id, ctl00_ContentPlaceHolder1_btnNext).click ie.file_field(:id, ctl00_ContentPlaceHolder1_Uploadfile).set(D:\ \BCSBI.zip) ie.file_field(:id, ctl00_ContentPlaceHolder1_btnUpload).click # For handling popups require 'win32ole' autoit = WIN32OLE.new('AutoItX3.Control') # Opt(WinTitleMatchMode, 3) autoit.WinWait('Windows Internet Explorer', '', 2) autoit.WinActivate('Windows Internet Explorer') autoit.Send('{~}') if ie.radio(:id, ctl00_ContentPlaceHolder1_RdlistisFeedback_1).isSet? puts IS FEEDBACK option Yes is selected else ie.radio(:id, ctl00_ContentPlaceHolder1_RdlistisFeedback_1).click end ie.select_list(:id, ctl00_ContentPlaceHolder1_DdlAccesstype).set (Public) ie.select_list(:id, ctl00_ContentPlaceHolder1_DdlApprovaltype).set(Admin) end end Please suggest me a solution thankingyou On Apr 9, 9:24 am, kiran yajamanyam kiranyajaman...@gmail.com wrote: missed this piece of code require 'win32ole' still if it wont work just comment out Opt(WinTitleMatchMode, 3) code and try. If still it wont work please send me the scenario u are testing i will try and give u the code. Regards, Kiran Y On Thu, Apr 9, 2009 at 9:26 AM, spike vinaykumarl...@gmail.com wrote: I used this code but i'm getting the following error 1) Error: test_manage_resources(Manageresources): NoMethodError: undefined method `Opt' for #Manageresources:0x2b697c8 manageresource.rb:25:in `test_manage_resources' so please suggest some solution... On Apr 9, 8:40 am, kiran yajamanyam kiranyajaman...@gmail.com wrote: hi, handle the popup window using autoit. install autoit software. and use the followinf code autoit = WIN32OLE.new('AutoItX3.Control') Opt(WinTitleMatchMode, 3) autoit.WinWait('Windows Internet Explorer', '', 2) autoit.WinActivate('Windows Internet Explorer') autoit.Send('{enter}') This will work fine with out any issue Regards, Kiran Y On Wed, Apr 8, 2009 at 5:56 PM, spike vinaykumarl...@gmail.com wrote: Hi I'm woking on windows platform and IE7 using WATIR I've used the following code for handling JavaScript popup require 'win32ole' wsh WIN32OLE.new('Wscript.Shell') wsh.AppActivate('Windows Internet Explorer') wsh.Sendkeys('{ENTER}') but
[wtr-general] Re: Handling popups using watir
ya but the solutions are not working for me. On Apr 9, 10:35 am, George george.sand...@gmail.com wrote: Didn't you just make a thread about this? On Apr 8, 9:23 pm, spike vinaykumarl...@gmail.com wrote: Hi Can somebody please help me with handling popups using Watir i'm stuck with this. I tried many suggestions but it didnt help me. I'm working on Windows XP and Internet Explorer 7. somebody suggested me to install autoIt for handling popups so i've installed autoIT-v3 also. please please.. help me to handle popups like file download and javascript thankingyou- 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: Error in handling popup
Sorry sir even it is not working i've to click it manually to go further in my test. wat about this autoit i've installed autoit-v3 how is it related to watir..? On Apr 9, 10:43 am, kiran yajamanyam kiranyajaman...@gmail.com wrote: make sure that ur caption is same (Including caps) and if autoit.Send({'enter'}) is not working try with autoit.Send({'space'}) On Thu, Apr 9, 2009 at 11:10 AM, spike vinaykumarl...@gmail.com wrote: if i'm clicking the OK button manually its going further to do rest of the operations or els its hung with the popup On Apr 9, 10:38 am, kiran yajamanyam kiranyajaman...@gmail.com wrote: You have to give the exact caption of the window which is appearing as popup. In your case that caption of the pop up is FILE UPLOADED SUCCESSFULLY try this code: autoit = WIN32OLE.new('AutoItX3.Control') Opt(WinTitleMatchMode, 3) autoit.WinWait('FILE UPLOADED SUCCESSFULLY', '', 2) autoit.WinActivate('FILE UPLOADED SUCCESSFULLY') autoit.Send('{enter}') if you are online in g-talk you can ping me. Regards, Kiran Y kiranyajaman...@gmail.com On Thu, Apr 9, 2009 at 11:02 AM, spike vinaykumarl...@gmail.com wrote: Ya it still didnt work for me Test Scenario I'm running on windows platform with IE7 I've to upload a file to the application i'm testing. to do that i'm login to the application and navigating to the respective page where i've to upload the file. I'm able to upload the file, upon successfully uploading the fiel a POPUP appears with the msg FILE UPLOADED SUCCESSFULLY and it has a button OK which has to clicked for the popup to disappear. i'm stuck here. the code is not clicking the OK button. following is the script i'm running. require 'Watir' require 'test/unit' class Manageresources Test::Unit::TestCase def test_manage_resources ie = Watir::IE.start http://192.168.25.10:215/; ie.maximize() ie.text_field(:name, Login1$UserName).set(vinay) ie.text_field(:name, Login1$Password).set(welcome) ie.checkbox(:name, Login1$RememberMe).click ie.button(:value, Log In).click ie.link(:href, http://192.168.25.10:215/administrator/ Default.aspx).click ie.link(:href, javascript:__doPostBack ('ctl00$Menu1','Resources')).click ie.link(:href, http://192.168.25.10:215/admin/ ManageResources.aspx).click ie.link(:id, ctl00_ContentPlaceHolder1_lnkAdd).click ie.radio(:id, ctl00_ContentPlaceHolder1_rdCourses_1).click ie.button(:id, ctl00_ContentPlaceHolder1_btnNext).click ie.file_field(:id, ctl00_ContentPlaceHolder1_Uploadfile).set(D:\ \BCSBI.zip) ie.file_field(:id, ctl00_ContentPlaceHolder1_btnUpload).click # For handling popups require 'win32ole' autoit = WIN32OLE.new('AutoItX3.Control') # Opt(WinTitleMatchMode, 3) autoit.WinWait('Windows Internet Explorer', '', 2) autoit.WinActivate('Windows Internet Explorer') autoit.Send('{~}') if ie.radio(:id, ctl00_ContentPlaceHolder1_RdlistisFeedback_1).isSet? puts IS FEEDBACK option Yes is selected else ie.radio(:id, ctl00_ContentPlaceHolder1_RdlistisFeedback_1).click end ie.select_list(:id, ctl00_ContentPlaceHolder1_DdlAccesstype).set (Public) ie.select_list(:id, ctl00_ContentPlaceHolder1_DdlApprovaltype).set(Admin) end end Please suggest me a solution thankingyou On Apr 9, 9:24 am, kiran yajamanyam kiranyajaman...@gmail.com wrote: missed this piece of code require 'win32ole' still if it wont work just comment out Opt(WinTitleMatchMode, 3) code and try. If still it wont work please send me the scenario u are testing i will try and give u the code. Regards, Kiran Y On Thu, Apr 9, 2009 at 9:26 AM, spike vinaykumarl...@gmail.com wrote: I used this code but i'm getting the following error 1) Error: test_manage_resources(Manageresources): NoMethodError: undefined method `Opt' for #Manageresources:0x2b697c8 manageresource.rb:25:in `test_manage_resources' so please suggest some solution... On Apr 9, 8:40 am, kiran yajamanyam kiranyajaman...@gmail.com wrote: hi, handle the popup window using autoit. install autoit software. and use the followinf code autoit = WIN32OLE.new('AutoItX3.Control') Opt(WinTitleMatchMode, 3) autoit.WinWait('Windows Internet Explorer', '', 2) autoit.WinActivate('Windows Internet Explorer') autoit.Send('{enter}') This will work fine with out any issue Regards, Kiran Y On Wed, Apr 8, 2009 at 5:56 PM, spike vinaykumarl...@gmail.com wrote: Hi I'm woking on windows platform and IE7 using WATIR I've used the following code for handling JavaScript popup require 'win32ole' wsh