Re: [Wtr-general] Watir and smartclient
What is that you are looking for help with? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sadeesh Vinoth Sent: Thursday, April 19, 2007 7:28 AM To: wtr-general@rubyforge.org Subject: Re: [Wtr-general] Watir and smartclient Can anyone help me. ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
[Wtr-general] Your Opinion
I hope this isnt unappropriate but I figured that since it was a general community for WATIR it would be ok. I have developed a small test engine for hanlding automated testing of application UIs. I was looking to get some feedback on how it can improve. Here is the source forge link to the project: http://sourceforge.net/projects/after There is an installer for the latest release. Though the latest changes that I will mention next havent been released in an installer yet so you way want to get the latest files from the repository using SVN. The goal of the engine is to provide a common testing engine to handle UI testing of any application type. So I have written application libraries that consume WATIR for Internet Explorer browsers and one that consumes AutoIt to handle testing against Windows EXE applications. The tests are written in XML currently but with the latest change I just made that is now configurable as well. So I only have an XmlScriptReader class but there could be an ExcelScriptReader, CSVScriptReader or whatever else and it could work the same way. Also the results are output in an XML format and there are XSL scripts available that would allow that data to be consumed by CruiseControl or other continuous integration systems. Thanks again for any feedback that you can offer. ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Your Opinion
This won't affect anything that you have installed. It is meant to consume WATIR. It is self contained. -Original Message- From: [EMAIL PROTECTED] on behalf of Walter Kruse Sent: Tue 3/27/2007 11:08 PM To: wtr-general@rubyforge.org Subject: Re: [Wtr-general] Your Opinion How will installing this affect my current Watir installation ? From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sergio Pinon Sent: 28 March 2007 04:09 AM To: wtr-general@rubyforge.org Subject: [Wtr-general] Your Opinion I hope this isn't unappropriate but I figured that since it was a general community for WATIR it would be ok. I have developed a small test engine for hanlding automated testing of application UI's. I was looking to get some feedback on how it can improve. Here is the source forge link to the project: http://sourceforge.net/projects/after There is an installer for the latest release. Though the latest changes that I will mention next haven't been released in an installer yet so you way want to get the latest files from the repository using SVN. The goal of the engine is to provide a common testing engine to handle UI testing of any application type. So I have written application libraries that consume WATIR for Internet Explorer browsers and one that consumes AutoIt to handle testing against Windows EXE applications. The tests are written in XML currently but with the latest change I just made that is now configurable as well. So I only have an XmlScriptReader class but there could be an ExcelScriptReader, CSVScriptReader or whatever else and it could work the same way. Also the results are output in an XML format and there are XSL scripts available that would allow that data to be consumed by CruiseControl or other continuous integration systems. Thanks again for any feedback that you can offer. ** Everything in this e-mail and attachments relating to the official business of MultiChoice Africa is proprietary to the company. Any view or opinion expressed in this message may be the view of the individual and should not automatically be ascribed to the company. If you are not the intended recipient, you may not peruse, use, disseminate, distribute or copy this message. If you have received this message in error, please notify the sender immediately by email, facsimile or telephone and destroy the original message. ** winmail.dat___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] WIN32OLERuntimeError: unknown property or method`readOnly'
Jeff, I'm sure Charley will answer this as well but I just looked at it right now and if you look at the page source you will see that the control you were trying to access was a label and not a textfield. The label had the id of label_user_email. The textbox had the id of user_email. You probably just accidentally were looking at the label control and not the textbox control when you were determining the id to use. Sergio From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jeff Fry Sent: Thursday, March 08, 2007 1:26 PM To: wtr-general@rubyforge.org Subject: Re: [Wtr-general] WIN32OLERuntimeError: unknown property or method`readOnly' Thanks Charlie - you rock! Out of curiosity, how did you know to change (:id, 'label_user_email') to (:id, 'user_email') ? Was there something in the page source that I missed? Or did you just experiment with taking 'label_' off? ...Or asked differently, why did using 'label_user_email' give the error it did, rather than just telling me that the object was not found? Jeff On 3/8/07, Charley Baker [EMAIL PROTECTED] wrote: Had to change the id's you were using to access the html elements, this should work: require 'watir' include Watir require 'test/unit' class TC_SendManyMessages Test::Unit::TestCase $email = '[EMAIL PROTECTED]' $pw = 'password' def test_send_many_messages ie = IE.start('http://www.divinecaroline.com/public/login/show_login_page' http://www.divinecaroline.com/public/login/show_login_page%27 ) ie.text_field(:id, 'user_email').set($email) ie.text_field(:id,'user_password').set($pw) ie.button(:name, 'login_button').click end end -Charley On 3/8/07, Jeff Fry [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Hey Charley, thanks for taking a look! Yeah, I mistakenly pasted an internal url. Our public site is: http://www.divinecaroline.com/public/login/show_login_page http://carolinerr.realgirlsmedia.local/public/login/show_login_page Jeff On 3/8/07, Charley Baker [EMAIL PROTECTED] wrote: Hey Jeff, I'm not able to get to the site you have listed in your test, seems the url might be local to your internal network? When you include unittests/setup there's a line at the beginning there: END {$ie.close if $ie; Watir:: IE.quit} which closes ie when your tests are done running. -Charley On 3/7/07, Jeff Fry [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Hi all, I am getting an unfamiliar error and hoping someone can lend a hand. I'm currently using Watir 1.5.1.1145 I just got: ruby create_many_messages.rb Loaded suite create_many_messages Started E Finished in 4.544 seconds. 1) Error: test_send_many_messages(TC_SendManyMessages): WIN32OLERuntimeError: unknown property or method `readOnly' HRESULT error code:0x80020006 Unknown name. (eval):3:in `invoke' (eval):3:in `readonly?' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1145/./watir.rb:3798:in `assert_not_readonly' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1145/./watir.rb:3884:in `set' create_many_messages.rb:17:in `test_send_many_messages' 1 tests, 0 assertions, 0 failures, 1 errors Exit code: 1 After trying: $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') if $0 == __FILE__ require 'unittests/setup' class TC_SendManyMessages Test::Unit::TestCase include Watir $email = [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] $pw = password def test_send_many_messages $ie.goto(http://carolinerr.realgirlsmedia.local/public/login/show_login _page ) $ie.text_field(:id ,label_user_email).set($email)# THIS IS THE LINE IT CHOKES ON $ie.text_field(:id ,label_user_password).set($pw) $ie.link(:name, login_button).click end #def end A search of the archives gave me http://forums.openqa.org/thread.jspa?messageID=10228 ...but this seems to have been fixed in 9/06, so I think I must be hitting something different. Am I screwing something up here? BTW, our site is public so the code above should execute for you...just as poorly as it executes for me. ;0) Thanks in advance for any help, Jeff BTW, I remember in the past watir left IE open unless I explicitly called ie.close. When I'm coding, I often like to leave IE open to see where I bombed. Is there a way I can switch back to not automagically cleaning up while I'm coding? I did a quick search of watir.rb but
Re: [Wtr-general] Moving to OpenQA.org
Yeah I will look into them and see what I come up with. From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Bret Pettichord Sent: Tuesday, March 14, 2006 3:57 PM To: wtr-general@rubyforge.org Subject: Re: [Wtr-general] Moving to OpenQA.org On 3/12/06, Sergio Pinon [EMAIL PROTECTED] wrote: I don't know. What do you need help with? There are lots of known bugs mentioned in this email list, some of which have fixes. A lot of the traffic here is discussing them. (Is this a known bug?) It would be a big help if you could search through the email list and collect these items in our new bug tracking system, Jira: http://jira.openqa.org/browse/WTR ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Moving to OpenQA.org
I don't know. What do you need help with? From: [EMAIL PROTECTED] on behalf of Bret Pettichord Sent: Fri 3/10/2006 8:56 PM To: wtr-general@rubyforge.org Subject: Re: [Wtr-general] Moving to OpenQA.org On 3/10/06, Sergio Pinon [EMAIL PROTECTED] wrote: I would be able to help. Glad to hear it. Let us know what you want to help with. What can you do? winmail.dat___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] How do you find a specific string in an HTML page?
I always like to use the _javascript_ objects. So one way is to be able to get the _javascript_ underlying object from the div reference in WATIR. Then when you get that just call the getAttribute() method on that object and pull out the attribute that you would like. Another way would be to use the XML Xpath against the DOM to pull the data that you want. I am not too familiar with this but I know it can be done. Sergio From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paul Carvalho Sent: Thursday, February 09, 2006 1:14 PM To: wtr-general@rubyforge.org Subject: [Wtr-general] How do you find a specific string in an HTML page? Hi there, I am trying to find a way to find a particular string in an HTML page and save it to a variable. It seems simple enough, but I can't find the commands to help me do it yet. Our Dot-Net app assigns Unique ID's to various objects within the system. For example, if you create a new Customer in an Order-Taking system, the new Customer is assigned a unique ID (let's call it customerID). When I look at the HTML page, I see that UID in various places. For example: (a) within a div tag (within a custom attribute unrecognised by Watir) (b) within an a href link (part of the URL - e.g. http://www.../../ShowCustomer.aspx?mode=editcustomerID=1234asdf-5678hjlk) I know that I can use the contains_text() to look for text on the page. I can also use ie.frame(frameName).html.to_s to capture the contents of the frame. So how can I tell Watir to find the customerID= phrase and then capture the next [fixed-number] set of characters into a string variable? Thanks in advance. Paul. ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Anyone use Test::Unit::Reporter? Fwd: Help withFile.join(File.dirname(__FILE__), '..') ?
Chris, I have no idea what Reporter is but a while back I submitted a testing framework that sits on top of WATIR and the results are generated in an xml form which I then have parsed by CCNET. Don't know if this is something that you are looking for but if you would like to check it out I can send it to you. Sergio -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Chris McMahon Sent: Monday, January 30, 2006 8:02 PM To: wtr-general@rubyforge.org Subject: Re: [Wtr-general] Anyone use Test::Unit::Reporter? Fwd: Help withFile.join(File.dirname(__FILE__), '..') ? By the way, I still hold the admin rights to the corresponding RubyForge project. if you use Test::Unit::Reporter nowadays and want it to suck less, feel free to create yourself a RubyForge account and write me for the commit rights. Apologies, but is there anything besides Reporter that would help me talk to CCNET that sucks less than Reporter? I've got a rubyforge account, but I'm a lot more interested in talking to CruiseControl than I am in have Reporter not suck. Call it pragmatism :) -Chris ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Another JavaScript Question
This might be another possibility to try: Get the underlying _javascript_ DOM object from the browser: js_dom = ie_browser.getDocument(); At this point you can execute any _javascript_ methods you want against the browser. Since you dont have any name or id attributes you can get the objects by type. hyperlinks = js_dom.getElementsByTagName(A); At the point the hyperlinks variable represents a collection of all of the links in your page. So if you know the index of the hyperlink you can just do that. Or you can loop through them all and try to determine which one to use. hyperlinks[1].click() or for I in 0..hyperlinks.length do something with hyperlinks[i] end Of course this is just one option. I would say your best option would be to try and give these hyperlinks sometype of identifier. (name, id, etc) Sergio From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of David Solis Sent: Wednesday, January 25, 2006 9:01 PM To: wtr-general@rubyforge.org Subject: [Wtr-general] Another _javascript_ Question All, I've been trying desperately for over week to figure out how to click on _javascript_ button to no avail. I have tried just about everybody's suggestions. Mark Cain's solution posted last weeklooked very promising, but can't get it to work. Here is the code that contains the buttons (cancel update) Ineed to click on: table cellpadding=0 cellspacing=0 border=0 width=300 tr tdimg src=/images/admin/form_top_left.gif/td td background="">/images/admin/form_top_tile.gifimg src="">/images/admin/spacer.gif width=10 height=48/td tda >return validate_form('ADMINPayModelUpdate','enable') >imgswap('enablealltop', 'form_top_enableall_over'); return false; >imgswap('enablealltop', 'form_top_enableall_up'); return false;img NAME=enablealltop src="">/images/admin/form_top_enableall_up.gif value=Enable all border=0/aa >return validate_form('ADMINPayModelUpdate','disable') >imgswap('disablealltop', 'form_top_disableall_over'); return false; >imgswap('disablealltop', 'form_top_disableall_up'); return false;img border=0 NAME=disablealltop src="">/images/admin/form_top_disableall_up.gif value=Disable all/a/td td background="">/images/admin/form_top_tile.gifimg src="">/images/admin/spacer.gif width=226 height=48/td tda href="">_javascript_:document.ADMINPayModel.reset() >return validate_form('ADMINPayModelUpdate','cancel') >imgswap('canceltop', 'form_top_cancel_over'); return false; >imgswap('canceltop', 'form_top_cancel_up'); return false;img NAME=canceltop src="">/images/admin/form_top_cancel_up.gif border=0/aa href=""># >return validate_form('ADMINPayModelUpdate','update') >imgswap('updatetop', 'form_top_update_over'); return false; >imgswap('updatetop', 'form_top_update_up'); return false;img NAME=updatetop src="">/images/admin/form_top_update_up.gif value=Update border=0/a/td td background="">/images/admin/form_top_tile.gifimg src="">/images/admin/spacer.gif width=6 height=48/td tdimg src="">/images/admin/form_top_right.gif/td /tr /tableThanks!David Do you Yahoo!? With a free 1 GB, there's more in store with Yahoo! Mail. ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Tab Click
Some thoughts: Can you give the td that contains the text you want clicked an ID attribute. If so then you could try accessing the td directly and calling the click method on it. This can be done with _javascript_ using the following code. ie_browser.getDocument().getElementById([table cell id]).click() That should work if you can do something like that. From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Chintakrindi Meghanath Sent: Thursday, January 26, 2006 10:27 AM To: wtr-general@rubyforge.org Subject: Re: [Wtr-general] Tab Click HI All Can anyone , give solution, I am struck at this point . Thanks Meghanath -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of Chintakrindi Meghanath Sent: Thursday, January 26, 2006 9:58 AM To: wtr-general@rubyforge.org Subject: Re: [Wtr-general] Tab Click Hi I tried with this options also , but not working. It is not throwing any error, but its not clicking that 'Tab' Thanks Meghanath -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of Bret Pettichord Sent: Wednesday, January 25, 2006 4:09 PM To: wtr-general@rubyforge.org Subject: Re: [Wtr-general] Tab Click How 'bout this: ie.div(:id, 'LineTab').cell(:text, 'Contents').click (If this doesn't work, please describe what it actually does. Error?) Bret On 1/25/06, Chintakrindi Meghanath [EMAIL PROTECTED] wrote: Hi I aleady tried with that option , but its not working Thanks Meghanath -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Bret Pettichord Sent: Wednesday, January 25, 2006 2:10 PM To: wtr-general@rubyforge.org Subject: Re: [Wtr-general] Tab Click ie.div(:id, 'LineTab').click On 1/25/06, Chintakrindi Meghanath [EMAIL PROTECTED] wrote: Hi All My web application contains two tabs in one of the transaction Detail and Contents After entering the data in the Detail page, using will be saving that record and clicks on Contents. I am trying to make a script for that Can anyone help me out, how to click on Contents. I tried with most of the objects, but its not going through. The following is the source code div id='DetailTab' style='position:absolute; left:0px; top:12px; width:595px; height:30px; z-index:1;align=left;visibility:hidden;' table width='595' cellspacing='0' cellpadding='0' border=0 align='center' trtd width='10'img name='a' src='' width='10' height='20' border='0'//td td width='81' background='' class='blktext1' align='center' valign='bottom'Detailbrimg name='a' src='' width='1' height='3' border='0'//td td width='81' background='' class='blktext1' align='center' valign='bottom' style='cursor:hand'Contentsbrimg name='a' src='' width='1' height='3' border='0'//td td width='423'img name='a' src='' width='423' height='20' border='0'//td /tr /table /div div id='LineTab' style='position:absolute; left:0px; top:12px; width:595px; height:30px; z-index:1;align=left;visibility:hidden;' table width='595' cellspacing='0' cellpadding='0' border=0 align='center' trtd width='10'img name='a' src='' width='10' height='20' border='0'//td td width='81' background='' class='blktext1' align='center' valign='bottom' style='cursor:hand'Detailbrimg name='a' src='' width='1' height='3' border='0'//td td width='81' background='' class='blktext1' align='center' valign='bottom'Contentsbrimg name='a' src='' width='1' height='3' border='0'//td td width='423'img name='a' src='' width='423' height='20' border='0'//td /tr /table /div Thanks Meghanath ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Tab Click
Did you try the solution that I mentioned. Give the td an id attribute and then you are golden. You shouldnt have any problems. Sergio From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Chintakrindi Meghanath Sent: Thursday, January 26, 2006 12:00 PM To: wtr-general@rubyforge.org Subject: Re: [Wtr-general] Tab Click Hi I stepped through the IRB and getting the following error exception. I used link, button , image etc Watir::Exception::UnknownObjectException: Unable to locate object, using value a nd (?-mix:Contents) When I used div, its not throwing any message, but no object is returned. Thanks Meghanath -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of Sergio Pinon Sent: Thursday, January 26, 2006 2:03 PM To: wtr-general@rubyforge.org Subject: Re: [Wtr-general] Tab Click Some thoughts: Can you give the td that contains the text you want clicked an ID attribute. If so then you could try accessing the td directly and calling the click method on it. This can be done with _javascript_ using the following code. ie_browser.getDocument().getElementById([table cell id]).click() That should work if you can do something like that. From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Chintakrindi Meghanath Sent: Thursday, January 26, 2006 10:27 AM To: wtr-general@rubyforge.org Subject: Re: [Wtr-general] Tab Click HI All Can anyone , give solution, I am struck at this point . Thanks Meghanath -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of Chintakrindi Meghanath Sent: Thursday, January 26, 2006 9:58 AM To: wtr-general@rubyforge.org Subject: Re: [Wtr-general] Tab Click Hi I tried with this options also , but not working. It is not throwing any error, but its not clicking that 'Tab' Thanks Meghanath -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of Bret Pettichord Sent: Wednesday, January 25, 2006 4:09 PM To: wtr-general@rubyforge.org Subject: Re: [Wtr-general] Tab Click How 'bout this: ie.div(:id, 'LineTab').cell(:text, 'Contents').click (If this doesn't work, please describe what it actually does. Error?) Bret On 1/25/06, Chintakrindi Meghanath [EMAIL PROTECTED] wrote: Hi I aleady tried with that option , but its not working Thanks Meghanath -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Bret Pettichord Sent: Wednesday, January 25, 2006 2:10 PM To: wtr-general@rubyforge.org Subject: Re: [Wtr-general] Tab Click ie.div(:id, 'LineTab').click On 1/25/06, Chintakrindi Meghanath [EMAIL PROTECTED] wrote: Hi All My web application contains two tabs in one of the transaction Detail and Contents After entering the data in the Detail page, using will be saving that record and clicks on Contents. I am trying to make a script for that Can anyone help me out, how to click on Contents. I tried with most of the objects, but its not going through. The following is the source code div id='DetailTab' style='position:absolute; left:0px; top:12px; width:595px; height:30px; z-index:1;align=left;visibility:hidden;' table width='595' cellspacing='0' cellpadding='0' border=0 align='center' trtd width='10'img name='a' src='' width='10' height='20' border='0'//td td width='81' background='' class='blktext1' align='center' valign='bottom'Detailbrimg name='a' src='' width='1' height='3' border='0'//td td width='81' background='' class='blktext1' align='center' valign='bottom' style='cursor:hand'Contentsbrimg name='a' src='' width='1' height='3' border='0'//td td width='423'img name='a' src='' width='423' height='20' border='0'//td /tr /table /div div id='LineTab' style='position:absolute; left:0px; top:12px; width:595px; height:30px; z-index:1;align=left;visibility:hidden;' table width='595' cellspacing='0' cellpadding='0' border=0 align='center' trtd width='10'img name='a' src='' width='10' height='20' border='0'//td td width='81' background='' class='blktext1' align='center' valign='bottom' style='cursor:hand'Detailbrimg name='a' src='' width='1' height='3' border='0'//td td width='81' background='' class='blktext1' align='center' valign='bottom'Contentsbrimg name='a' src='' width='1' height='3' border='0'//td td width='423'img name='a' src='' width='423' height='20' border='0'//td /tr /table /div Thanks Meghanath ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Tab Click
If you gave that cell an id here is one way you can do it. Though there is also an Xpath _expression_ you can use though Im not too good with that. ie_browser.getDocument().getElementById([table cell id]).click() Try this. Sergio From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Chintakrindi Meghanath Sent: Thursday, January 26, 2006 2:14 PM To: wtr-general@rubyforge.org Subject: Re: [Wtr-general] Tab Click Hi Can you help me, how to get that table cell id Thanks Meghanath -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of Sergio Pinon Sent: Thursday, January 26, 2006 4:12 PM To: wtr-general@rubyforge.org Subject: Re: [Wtr-general] Tab Click Did you try the solution that I mentioned. Give the td an id attribute and then you are golden. You shouldnt have any problems. Sergio From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Chintakrindi Meghanath Sent: Thursday, January 26, 2006 12:00 PM To: wtr-general@rubyforge.org Subject: Re: [Wtr-general] Tab Click Hi I stepped through the IRB and getting the following error exception. I used link, button , image etc Watir::Exception::UnknownObjectException: Unable to locate object, using value a nd (?-mix:Contents) When I used div, its not throwing any message, but no object is returned. Thanks Meghanath -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of Sergio Pinon Sent: Thursday, January 26, 2006 2:03 PM To: wtr-general@rubyforge.org Subject: Re: [Wtr-general] Tab Click Some thoughts: Can you give the td that contains the text you want clicked an ID attribute. If so then you could try accessing the td directly and calling the click method on it. This can be done with _javascript_ using the following code. ie_browser.getDocument().getElementById([table cell id]).click() That should work if you can do something like that. From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Chintakrindi Meghanath Sent: Thursday, January 26, 2006 10:27 AM To: wtr-general@rubyforge.org Subject: Re: [Wtr-general] Tab Click HI All Can anyone , give solution, I am struck at this point . Thanks Meghanath -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of Chintakrindi Meghanath Sent: Thursday, January 26, 2006 9:58 AM To: wtr-general@rubyforge.org Subject: Re: [Wtr-general] Tab Click Hi I tried with this options also , but not working. It is not throwing any error, but its not clicking that 'Tab' Thanks Meghanath -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of Bret Pettichord Sent: Wednesday, January 25, 2006 4:09 PM To: wtr-general@rubyforge.org Subject: Re: [Wtr-general] Tab Click How 'bout this: ie.div(:id, 'LineTab').cell(:text, 'Contents').click (If this doesn't work, please describe what it actually does. Error?) Bret On 1/25/06, Chintakrindi Meghanath [EMAIL PROTECTED] wrote: Hi I aleady tried with that option , but its not working Thanks Meghanath -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Bret Pettichord Sent: Wednesday, January 25, 2006 2:10 PM To: wtr-general@rubyforge.org Subject: Re: [Wtr-general] Tab Click ie.div(:id, 'LineTab').click On 1/25/06, Chintakrindi Meghanath [EMAIL PROTECTED] wrote: Hi All My web application contains two tabs in one of the transaction Detail and Contents After entering the data in the Detail page, using will be saving that record and clicks on Contents. I am trying to make a script for that Can anyone help me out, how to click on Contents. I tried with most of the objects, but its not going through. The following is the source code div id='DetailTab' style='position:absolute; left:0px; top:12px; width:595px; height:30px; z-index:1;align=left;visibility:hidden;' table width='595' cellspacing='0' cellpadding='0' border=0 align='center' trtd width='10'img name='a' src='' width='10' height='20' border='0'//td td width='81' background='' class='blktext1' align='center' valign='bottom'Detailbrimg name='a' src='' width='1' height='3' border='0'//td td width='81' background='' class='blktext1' align='center' valign='bottom' style='cursor:hand'Contentsbrimg name='a' src='' width='1' height='3' border='0'//td td width='423'img name='a' src='' width='423' height='20' border='0'//td /tr /table /div div id='LineTab' style='position:absolute; left:0px; top:12px; width:595px; height:30px; z-index:1;align=left;visibility:hidden;' table width='595' cellspacing='0' cellpadding='0' border=0 align='center' trtd width='10'img name='a' src='' width='10' height='20
Re: [Wtr-general] Tricky checkbox selection
Title: Tricky checkbox selection David, I would need to see the code to see what is happening. But if you are getting the collection of objects with the same name and then trying to sort that array you cant. The reason is that the array of controls is really not an array it is unique object collection. If you want to send me some code I can take a look at it and see what I can come up with. The other thing that may help though I dont know your circumstance is that you can use Xpath expressions against the DOM so you might be able to do something like that. See the previous post below that might be able to help you out. Sergio PREVIOUS POST: Hi Paatsch, How about using XPath to get the element in just one line of code rather then using the loops? In your case it would be something like this: ie.checkbox(:xpath, //td[contains(., 'Test3')]/../td/input/).click() This XPath query first select the td containing text Test3 (this is what you said is fixed and known before hand), then it goes to its parent i.e. tr and then traverse down the tree to first td and then input element inside that td which is the checkbox element that you want. For using XPath download the tar ball from HEAD and read the documentation under the docs section. Hope this helps. Regards, Angrez From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Tuesday, January 24, 2006 8:52 AM To: wtr-general@rubyforge.org Subject: Re: [Wtr-general] Tricky checkbox selection I ran into a similar problem and your suggestion worked great. However, I ran into slightly different problem. In my case, I have a list of users that can be updated and deleted. Every time I add a user, the value is increased by 1. For example, input type=checkbox name=selectedUsers value=1user1 input type=checkbox name=selectedUsers value=2user2 and so on... To find the last index value, I sorted the array to give the largest number. Knowing this I can delete the last user created. The problem is this: When I try to use any of the built in Array methods other than Sergio example, I get the following error: WIN32OLERuntimeError: Unknown property or method `sort' HRESULT error code:0x80020006 Unknown name. C:/Tests/TestSuites/tc_smoketest_suite.rb:93:in `method_missing' C:/Tests/TestSuites/tc_smoketest_suite.rb:93:in `test_delete_user C:/Tests/TestSuites/tc_smoketest_suite.rb:92:in `each' C:/Tests/TestSuites/tc_smoketest_suite.rb:92:in `test_delete_user Whatam Idoing wrong? ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Random number generation.
I dont know too much about the first problem that you are having but as for your second one try this. I changed the max to be no higher than 9 and then you get a maximum of 5 digits. If you have less then I just concat zeros on the end. Hope this helps. Sergio def Random_number $rand_num = rand(max=9).to_s() while $rand_num.length 5 $rand_num 0 end puts (tester+ ($rand_num)) return $rand_num end From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Monday, January 23, 2006 11:31 AM To: wtr-general@rubyforge.org Subject: [Wtr-general] Random number generation. I have 2 questions: Can I use methodnames other then test_sometest in my script. For example, I have a method that performs a calculation and returns a value and passes that value to test method. Unless I rename my calculation method as test_calculation the method is not executed. I know that my class is inheriting from test::unit, but do I need to precede every method name with test? Secondly, I am trying to generate test users for my test by generating a random number and theconcatenating that number to a string test so that the result is test12345, for example. I'm using rand(max-0) to generate the number, but it returns a big number. So I tried stripping the number and then concatenating but it didn't work. Ultimately, I would like to have generate names with 5 digits randomly like the example above. Any ideas? def Random_name $rand_num = rand(max=0) $rand_num =~ /^0???/ $rand_user = $rand_num.to_s puts (tester+ ($rand_user)) return $rand_user end ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Tricky checkbox selection
Title: Tricky checkbox selection Ok no problem. I was just checking to make sure everything worked ok. No rush. From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paatsch, Bernd Sent: Monday, January 23, 2006 2:05 PM To: 'wtr-general@rubyforge.org' Subject: Re: [Wtr-general] Tricky checkbox selection Got a little sidetracked. variable = $ie.getDocument().getElementsByName(Add_member[]); This gives me the list of all three input elements. Now I need to find the right index. That's what I am working on right now. From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sergio Pinon Sent: Monday, January 23, 2006 1:58 PM To: wtr-general@rubyforge.org Subject: Re: [Wtr-general] Tricky checkbox selection Did you try the method I gave you? I wanted to know if it worked. Sergio From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paatsch, Bernd Sent: Monday, January 23, 2006 1:43 PM To: 'wtr-general@rubyforge.org' Subject: Re: [Wtr-general] Tricky checkbox selection The table is generated by an underlining database and the values are different almost every time. Only the string in the second td stays the same, e.g Test1, Test2, Test3 tr td input type=checkbox name=Add_member[] value=25 /td td Test1 /td/tr tr td input type=checkbox name=Add_member[] value=27 /td td Test2 /td/tr tr td input type=checkbox name=Add_member[] value=35 /td td Test3 /td/tr From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Cain, Mark Sent: Monday, January 23, 2006 1:38 PM To: wtr-general@rubyforge.org Subject: Re: [Wtr-general] Tricky checkbox selection You dont need to just try something like this. $ie.checkbox(:name, /Add_member/i, 35).set You can use regular expressions for your attribute name if you know part of what that name will be at runtimealthough it does get tricky when attribute names for an object are the same, in that case you can use :index. Indexes are 1 based currently (although I heard some rumbling as to think they will soon be zero based) and start with the first one on the page and continue through the last one on the page. --Mark From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paatsch, Bernd Sent: Monday, January 23, 2006 1:19 PM To: 'wtr-general@rubyforge.org' Subject: Re: [Wtr-general] Tricky checkbox selection I have almost none _javascript_ experience. How do I get the underlying _javascript_ object of that page? From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sergio Pinon Sent: Monday, January 23, 2006 11:12 AM To: wtr-general@rubyforge.org Subject: Re: [Wtr-general] Tricky checkbox selection Well the other thing to do is try the code below. What you do is get the underlying _javascript_ object of the page and then interact with it as you would with _javascript_. You get all the elements with the name you supply and then access the one you want using the indexer on that array. Then you just set the checked property of that object to true and it should work. Let me know how it turns out. ie_browser.getDocument().getElementsByName(Add_member[])[index of control].checked = true; From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paatsch, Bernd Sent: Monday, January 23, 2006 10:47 AM To: 'wtr-general@rubyforge.org' Subject: Re: [Wtr-general] Tricky checkbox selection Unfortunately I do not know the value beforehand. From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sergio Pinon Sent: Monday, January 23, 2006 10:45 AM To: wtr-general@rubyforge.org Subject: Re: [Wtr-general] Tricky checkbox selection Do you know the value of the checkbox beforehand? If you do then just use this method: Ie_browser.checkbox(:name, Add_member[], 35).set(); This should be good to go. Sergio From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paatsch, Bernd Sent: Monday, January 23, 2006 10:23 AM To: wtr-general@rubyforge.org Subject: [Wtr-general] Tricky checkbox selection Hello, I have following html code and like to select the checkbox for Test3. How can I do that? input type=checkbox name=Add_member[] value=25/tdtd Test1/tdtd Subscriber/tdtd208/td/tr input type=checkbox name=Add_member[] value=27/tdtd Test2/tdtd Subscriber/tdtd208/td/tr input type=checkbox name=Add_member[] value=35/tdtd Test3/tdtd Subscriber/tdtd208/td/tr Thanks. ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Tricky checkbox selection
Title: Tricky checkbox selection If you are trying to see information about these object then try something like the following: variable = $ie.getDocument().getElementsByName('cbxSelectGroup[]'); puts variable.each{|i| print i.value, \n} puts variable.length Add the value property on to the end of your object. So you see I did i.value. That should show you the value. Sergio From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paatsch, Bernd Sent: Monday, January 23, 2006 2:21 PM To: 'wtr-general@rubyforge.org' Subject: Re: [Wtr-general] Tricky checkbox selection variable = $ie.getDocument().getElementsByName('cbxSelectGroup[]'); puts variable.each{|i| print i, \n} puts variable.length As I said, I am new to _javascript_ and ruby. The code returns: #WIN32OLE:0x2a961b8 #WIN32OLE:0x2a96188 #WIN32OLE:0x2a96140 etc. which I believe represents memory locations? How can I get the values? From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sergio Pinon Sent: Monday, January 23, 2006 1:58 PM To: wtr-general@rubyforge.org Subject: Re: [Wtr-general] Tricky checkbox selection Did you try the method I gave you? I wanted to know if it worked. Sergio From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paatsch, Bernd Sent: Monday, January 23, 2006 1:43 PM To: 'wtr-general@rubyforge.org' Subject: Re: [Wtr-general] Tricky checkbox selection The table is generated by an underlining database and the values are different almost every time. Only the string in the second td stays the same, e.g Test1, Test2, Test3 tr td input type=checkbox name=Add_member[] value=25 /td td Test1 /td/tr tr td input type=checkbox name=Add_member[] value=27 /td td Test2 /td/tr tr td input type=checkbox name=Add_member[] value=35 /td td Test3 /td/tr From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Cain, Mark Sent: Monday, January 23, 2006 1:38 PM To: wtr-general@rubyforge.org Subject: Re: [Wtr-general] Tricky checkbox selection You dont need to just try something like this. $ie.checkbox(:name, /Add_member/i, 35).set You can use regular expressions for your attribute name if you know part of what that name will be at runtimealthough it does get tricky when attribute names for an object are the same, in that case you can use :index. Indexes are 1 based currently (although I heard some rumbling as to think they will soon be zero based) and start with the first one on the page and continue through the last one on the page. --Mark From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paatsch, Bernd Sent: Monday, January 23, 2006 1:19 PM To: 'wtr-general@rubyforge.org' Subject: Re: [Wtr-general] Tricky checkbox selection I have almost none _javascript_ experience. How do I get the underlying _javascript_ object of that page? From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sergio Pinon Sent: Monday, January 23, 2006 11:12 AM To: wtr-general@rubyforge.org Subject: Re: [Wtr-general] Tricky checkbox selection Well the other thing to do is try the code below. What you do is get the underlying _javascript_ object of the page and then interact with it as you would with _javascript_. You get all the elements with the name you supply and then access the one you want using the indexer on that array. Then you just set the checked property of that object to true and it should work. Let me know how it turns out. ie_browser.getDocument().getElementsByName(Add_member[])[index of control].checked = true; From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paatsch, Bernd Sent: Monday, January 23, 2006 10:47 AM To: 'wtr-general@rubyforge.org' Subject: Re: [Wtr-general] Tricky checkbox selection Unfortunately I do not know the value beforehand. From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sergio Pinon Sent: Monday, January 23, 2006 10:45 AM To: wtr-general@rubyforge.org Subject: Re: [Wtr-general] Tricky checkbox selection Do you know the value of the checkbox beforehand? If you do then just use this method: Ie_browser.checkbox(:name, Add_member[], 35).set(); This should be good to go. Sergio From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paatsch, Bernd Sent: Monday, January 23, 2006 10:23 AM To: wtr-general@rubyforge.org Subject: [Wtr-general] Tricky checkbox selection Hello, I have following html code and like to select the checkbox for Test3. How can I do that? input type=checkbox name=Add_member[] value=25/tdtd Test1/tdtd Subscriber/tdtd208/td/tr input type=checkbox name=Add_member[] value=27/tdtd Test2/tdtd Subscriber/tdtd208/td/tr input type=checkbox name=Add_member[] value=35/tdtd Test3/tdtd Subscriber/tdtd208/td/tr Thanks. ___ Wtr-general mailing list Wtr-general@rubyforge.org http
Re: [Wtr-general] Variable Number and Type of Method Parameters?
Not sure if you guys realize it but there is an xml library available in Ruby called REXML and from there you can use it in your WATIR scripts. I don't know if you saw my last post but I had written a small testing framework on top of Ruby and WATIR that utilizes REXML so that I can store my controls in an XML file and reference them from there. If you get a chance you might want to take a look to see how you can use the REXML library. Sergio From: [EMAIL PROTECTED] on behalf of Angrez Singh Sent: Fri 1/20/2006 12:35 AM To: wtr-general@rubyforge.org Subject: Re: [Wtr-general] Variable Number and Type of Method Parameters? Hi, I think XPath extenstion to WATiR would be helpful in this case. Please download the tar ball from HEAD and read the supporting document in the 'docs' directory. Regards, Angrez On 1/20/06, Andrew McFarlane [EMAIL PROTECTED] wrote: I am testing an application whose UI controls are often difficult to specify. Sometimes I can uniquely identify a control with one attribute, and sometimes I need 3 or 4. Sometimes I can't see the difference between multiple controls, so I need to use an index value as one of those 3 or 4 attributes. With WATIR, can I specify a control by using a variable number and kind of parameters? I have a watered-down-not-thread-safe-has-synchronization-problems Perl tool (that I would like to toss) emulated from WATIR where I can say: $browser-link( innerText = 'Modify', nameProp = qr(modifyProductContract), outerHTML = qr((Pro|Select|Value) Service), index = 4 )-click; I see that I can use regex's with WATIR (very good), so I just need to make sure that I can pass in any number of control attributes and values before I embrace WATIR. If I can, how do I do it? A hash? Something else? Thanks. Andrew McFarlane ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general winmail.dat___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Variable Number and Type of Method Parameters?
I dont understand. Youre saying that WATIR uses REXML to allow Xpath expressions against the IE DOM? Sergio From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Angrez Singh Sent: Friday, January 20, 2006 10:56 AM To: wtr-general@rubyforge.org Subject: Re: [Wtr-general] Variable Number and Type of Method Parameters? Hi Sergio, The XPath extension internally uses REXML only to find the elements in IE DOM. Regards, Angrez On 1/20/06, Sergio Pinon [EMAIL PROTECTED] wrote: Not sure if you guys realize it but there is an xml library available in Ruby called REXML and from there you can use it in your WATIR scripts. I don't know if you saw my last post but I had written a small testing framework on top of Ruby and WATIR that utilizes REXML so that I can store my controls in an XML file and reference them from there. If you get a chance you might want to take a look to see how you can use the REXML library. Sergio From: [EMAIL PROTECTED] on behalf of Angrez Singh Sent: Fri 1/20/2006 12:35 AM To: wtr-general@rubyforge.org Subject: Re: [Wtr-general] Variable Number and Type of Method Parameters? Hi, I think XPath extenstion to WATiR would be helpful in this case. Please download the tar ball from HEAD and read the supporting document in the 'docs' directory. Regards, Angrez On 1/20/06, Andrew McFarlane [EMAIL PROTECTED] wrote: I am testing an application whose UI controls are often difficult to specify.Sometimes I can uniquely identify a control with one attribute, and sometimes I need 3 or 4.Sometimes I can't see the difference between multiple controls, so I need to use an index value as one of those 3 or 4 attributes.With WATIR, can I specify a control by using a variable number and kind of parameters? I have a watered-down-not-thread-safe-has-synchronization-problems Perl tool (that I would like to toss) emulated from WATIR where I can say: $browser-link( innerText = 'Modify', nameProp = qr(modifyProductContract), outerHTML = qr((Pro|Select|Value) Service), index = 4 )-click; I see that I can use regex's with WATIR (very good), so I just need to make sure that I can pass in any number of control attributes and values before I embrace WATIR. If I can, how do I do it?A hash?Something else? Thanks. Andrew McFarlane ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] How to Have Watir Run Unattended?
Title: How to Have Watir Run Unattended? I know this may be a little bit of extra work but here is what we do and it works fine. We use CruiseControl.Net which is a service that runs on our build machine and runs at timed intervals or we can force it as well. But then from CruiseControl we have a Nant build kickoff that executes our build scripts which one of the things that is done in that is to execute our WATIR scripts. Hope this helps. But as you can see it can be done and with minimal setup really. CruiseControl and Nant are both very easy to setup and get running. Sergio From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Gordon, John Sent: Friday, January 20, 2006 2:30 PM To: wtr-general@rubyforge.org Subject: [Wtr-general] How to Have Watir Run Unattended? Hi all, Does anyone know how to set up Watir to run unattended? Im having troubles trying to do this using a Scheduled Task. Requirements: 1) Execute a Watir script without having to have a user login to the computer to execute it (e.g via a Service or Scheduled task). 2) Have the script notify the developers when testing fails (via email or updating a web page). Im trying to set up a Watir script to serve as a heart beat of sorts for my web site. The idea is that I have a watir script constantly running that tests a website and notifies our development team (via email or a status web page) when the scripts fail. I thought I would do it by creating a Windows Scheduled task that would periodically call my Watir Script. Im getting an error when I execute this scheduled task, however. The error is: Failed to create WIN32OLE object from `InternetExplorer.Application' HRESULT error code:0x80070005 Access is denied. The script runs fine when I execute it via a command prompt. The user the Scheduled Task is running under is an admin account, so that should be fine too. The only thing Im doing in the script is calling IE.new(); thats where the error occurs. Im wondering if the problem is due to IE being a GUI app and scheduled tasks dont display GUIs. I tested this by creating a Scheduled Task to simply instantiate an instance of IE; it worked without errors. Heres the test Im running: require 'watir' require 'test/unit' require 'ftools' class TC_MyCompany Test::Unit::TestCase include Watir def test_hello_world @ie = IE.new() #BOOM!! Error happens here. @ie.close() t = Time.now time_stamp = t.strftime(Printed on %m/%d/%Y at %I:%M%p) File.open('E:\Watir\hello.txt', w+) { |msg_file| msg_file.write(successfully opened IE at #{time_stamp}) } rescue File.open('E:\Watir\hello.txt', w+) { |msg_file| msg_file.write($!) } end end Thanks for any help you can offer! John ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] How to click a button that has no id or name attribute
Title: How to click a button that has no id or name attribute You can just click the button by using the value attribute: browser.button(:value, Login).click; That should work just fine. Sergio From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paatsch, Bernd Sent: Friday, January 20, 2006 5:02 PM To: wtr-general@rubyforge.org Subject: [Wtr-general] How to click a button that has no id or name attribute input class=rec_butt type=submit value=Login I have this input button that I like to click. Unfortunate it has not id or name attribute attached to it. How can I click the button? --Bernd *** Bernd Paatsch Software Quality Assurance Engineer Active Voice LLC e-mail: [EMAIL PROTECTED] Phone: (206) 441-4700 x1026 ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] How is it possible to specify to look foraspec ifictext in a sp ecific tag?
Title: How is it possible to specify to look for a specific text in a specific tag? So if you have the control reference already then what you would do is: control_text = ie_browser.[control reference].text; if (control_text.index([text you are looking for]) != nil) The text is in the control. else The text is not in the control end Should be good with that. Sergio From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paatsch, Bernd Sent: Friday, January 20, 2006 4:59 PM To: 'wtr-general@rubyforge.org' Subject: Re: [Wtr-general] How is it possible to specify to look foraspec ifictext in a sp ecific tag? Could you give me an example? I am fairly new to web testing. Thanks. From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sergio Pinon Sent: Friday, January 20, 2006 4:29 PM To: wtr-general@rubyforge.org Subject: Re: [Wtr-general] How is it possible to specify to look for aspecifictext in a sp ecific tag? And actually an even easier way would be to get the Text property of the control and then do a check that way as well. There are several options that you have available. Sergio From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paatsch, Bernd Sent: Friday, January 20, 2006 3:58 PM To: 'wtr-general@rubyforge.org' Subject: [Wtr-general] How is it possible to specify to look for a specifictext in a sp ecific tag? I am fairly new to watir and think it is a great tool. I have following code that fails to execute. if ie.contains_text(:id, current :text, Groups) puts Login Failed!: else puts Login Passed! How is it possible to specify to look for a specific text in a specific tag? Thanks, Bernd ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] A testing framework
In regards to your first question I think the thought process behind that design was that I wanted something robust enough to be able to handle any web testing. I didn't want to have to write if statements for each control on each page so after researching I figured the easiest way would be to write libraries for each control type and then within those libraries handle every event that could be raised for each object type. Basically those are the core elements I felt that were needed to run a test. Secondly, for CruiseControl, all you need to do I smodify the config files to include your xsl files and then write your xsl files to be able to parse your xml and create the output. It was actually quite simple. Sergio -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Chris McMahon Sent: Monday, January 16, 2006 1:11 PM To: wtr-general@rubyforge.org Subject: Re: [Wtr-general] A testing framework Hi Sergio I recently spent sometime coming up with a simpler way to test my projects running from nant and using xml as the test. I would love to get some feedback on what ones think or ways that it can be improved. I have attached the entire framework for your review. At a glance, I can see what you're doing here. (Although I'm sure I fail to grasp the finer points from such a quick look.) If you don't mind a couple of questions... Your XML tests seem to contain 3 elements, control_type, control_object, and control_action, of which some take parameters. What drove these design decisions? That is, it seems efficient and useful in context, I wonder the process by which you arrived at this design. Also, I'm about to have to integrate some Ruby (not Watir) tests with CC.NET, and it would be great to hear what you had to do to get your Ruby code to interact nicely with CruiseControl. Thanks... -Chris ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general