Re: [Wtr-general] I am a newb
Doesnt work - Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=3917messageID=10851#10851 ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] I am a newb
I cant pull up irb. I am in the command prompt, it is defaulted at C:\Documents and Settings\user I have typed in irb here, I have changed the directory to just C:\ and tried. - Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=3917messageID=10853#10853 ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] I am a newb
Make sure the default ruby install directories (bin and lib) are in the PATH environment variable. The ruby installer should have done this by default, but maybe it didn't. For me it is: C:\ruby\bin;c:\ruby\lib Hope this helps, --Mark -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of David Sent: Tuesday, September 05, 2006 7:19 AM To: wtr-general@rubyforge.org Subject: Re: [Wtr-general] I am a newb I cant pull up irb. I am in the command prompt, it is defaulted at C:\Documents and Settings\user I have typed in irb here, I have changed the directory to just C:\ and tried. - Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=3917messageID=10853#10853 ___ 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] I am a newb
David,what do you do (exactly) and what happens when you do it? This is how I open irb:- click start- click Run...- type cmd in Open: text field- press enter - command prompt window opens with text:Microsoft Windows XP [Version 5.1.2600](C) Copyright 1985-2001 Microsoft Corp.C:\Documents and Settings\zfilipin- type irb - press enter- command prompt now looks like this:Microsoft Windows XP [Version 5.1.2600](C) Copyright 1985-2001 Microsoft Corp.C:\Documents and Settings\zfilipinirbirb(main):001:0 What do you get?Željko FilipinOn 9/5/06, David [EMAIL PROTECTED] wrote: I cant pull up irb. I am in the command prompt, it is defaulted at C:\Documents and Settings\user I have typed in irb here, I have changed the directory to just C:\ and tried. ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] I am a newb
1 javascript:logout(); Log Out 2 http://www2.lymba.com/test/propmen3/documents/Pana lyst_UserGuide.pdfUser Guide (PDF) 3 http://www2.lymba.com/test/propmen3/documents/Pana lyst_UserGuide.pdfUser Guide 4 http://www2.lymba.com/test/propmen3/documents/Pana lyst_TechnicalDescription.pdfTechnical Description and Algorithms 5 http://www2.lymba.com/test/propmen3/documents/Pana lyst_Assumptions.pdfPurpose and Assumptions 6 javascript:showSessionDialog('Restore'); Restore Session 7 javascript:buildClusters(); Create Panels 8 javascript:backHome(); New 9 javascript:revertPanels(); Revert Panels 10javascript:submitSearch(document.getElementById('s earchTypeSelect').value,%20document.getElementById('searchInput').value);Search 11undoButton javascript:undo(); Undo 12redoButton javascript:redo(); Redo 13javascript:clearReviewers(); Clear Reviewers 14javascript:assignReviewers(); Match Reviewers 15javascript:showExportDialog(); Export Data 16javascript:showSessionDialog('Save'); Save Session 17javascript:showSessionDialog('Restore'); Restore Session 18overviewModeLinkProposalsjavascript:setOverviewMode('Proposals ');Proposals 19overviewModeLinkReviewersjavascript:setOverviewMode('Reviewers ');Reviewers 20detailModeLinkProposalsjavascript:setDetailMode('Proposals'); Proposals 21detailModeLinkReviewersjavascript:setDetailMode('Reviewers'); Reviewers 22detailModeLinkAssignmentsjavascript:setDetailMode('Assignments ');Assignments 23detailModeLinkGridjavascript:setDetailMode('Grid'); Grid 24javascript:moveInspectedProposal(); Move 25javascript:moveInspectedReviewer(); Move 26sessionDialogCanceljavascript:hideSessionDialog(); Cancel 27javascript:exportData('clusters'); Export All Panels With Proposals 28javascript:exportData('reviewers'); Export Reviewer Data 29javascript:exportData('panels'); Export All Panels with Assignments 30sessionDialogCanceljavascript:hideExportDialog(); Cancel = nil irb(main):012:0 OK I hope this helps, I want to click or select the link on line 30. - Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=3917messageID=10855#10855 ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] I am a newb
I would agree with you and Bret on this, on general principle... except: What you say is all very well and good, until -- being a newbie -- you run into a problem that you cannot resolve, and which seems to make no sense. For some reason one of your applications starts using values from another... because you have them stored within the same Rails project (for one common example), and you used globals. And please keep in mind that people use Watir for things other than testing!! Without trying to be insulting, I must be honest and state that I find the strict testing-centric view to be more than a little myopic. Programmers for generations now -- quite literally human generations -- have warned against using global variables, and they have had excellent reason to do so. Those reasons have not changed. Globals have uses, or they would not exist. But usually, using them is bad practice. And I did not explain or have to explain this concept in depth; the basic idea was to change a $ to an @. That does not have to be attached to deep understanding in order to be useful. You say you were not trying to shoot the messenger, but this messenger has a definite impression of getting shot at, for giving someone good advice which I had very good reason to give the way I did. Why could you not just leave it alone? Lonny Eachus = Subject: Re: [Wtr-general] I am a newb From: "Paul Carvalho" [EMAIL PROTECTED] Date: Fri, 1 Sep 2006 16:57:22 -0400 Word to the wise.. On 01/09/06, Lonny Eachus [EMAIL PROTECTED] wrote: David, sometimes these people forget what it is like to be a newb, and give you specific information might be helpful *IF* you had a context in which to put it. From what you say, it appears you need some more general information first. [snip] $ie.link(:id, 'sessionDialogCancel').click However, I will caution you that it is usually not a good idea to use global variables like $ie. In the vast majority of cases, you will want to use an instance variable instead, which uses the @ sign. So rather than $ie you would have @ie. I hardly think that bringing up the difference between global and instance variables to someone who doesn't know how to start IRB is a good idea right now. I think you should follow your own advice and keep things simple right now. I don't consider myself a newb anymore but I still can't be bothered working out the difference between global and instance variables in my scripts. $ie works quite nicely for me and I am really not interested in sorting out the difference right now. Global/class/instance/local variables all have their place and everyone has their own ideas about how to use them based on their level of programming experience. Do you really think this is the right time to spring them on David? I remember all too well the frustrations I went through in the beginning trying to figure out Ruby and Watir and getting advanced advice like yours above that had almost no meaning to me whatsoever from where I was coming from. Points for hitting the target, but you missed the bullseye. (i.e. added to the confusion factor) Just a friendly reminder. (I'm not shooting the messenger, just letting you know that I don't believe the message was helpful this time.) Cheers. Paul. (The recent post-newb who's more interested in solving testing problems with scripts than learning to become a programmer.) ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
[Wtr-general] I am a newb
Ok so I just started using ruby and watir, when I say just started I mean no programming experience. The company I work for has me using/learning Watir. I can't make it click a button. I can make it click other buttons though. The software we developed doesnt use buttons per say, but something using href's and that such. I was wondering when you tell watir to ie.link(:text, Cancel).click , does it search the page source for just cancel? We have several so-called buttons named cancel. Does watir just hit the first cancel? If so how do I make it hit this specific cancel? Any thought are much appreciated. - Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=3917messageID=10762#10762 ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] I am a newb
On 9/1/06, David [EMAIL PROTECTED] wrote: Ok so I just started using ruby and watir, when I say just started I mean no programming experience. Welcome! The company I work for has me using/learning Watir. I can't make it click a button. I can make it click other buttons though. The software we developed doesnt use buttons per say, but something using href's and that such. I was wondering when you tell watir to ie.link(:text, Cancel).click , does it search the page source for just cancel? We have severalso-called buttons named cancel. Does watir just hit the first cancel? If so how do I make it hit this specific cancel? Any thought are much appreciated. So I have several suggestions: Use view source to look at the HTML in the page. All of the clickable things should have a value id=foo. Use id to identify page elements to Watir whenever possible. Download Microsoft's Internet Explorer Developer's Toolbar here: http://www.microsoft.com/downloads/details.aspx?familyid=e59c3964-672d-4511-bb3e-2d5e1db91038displaylang=en It allows you to easily see things about all of the elements on the page. Finally, we like helping newbs, but it is immensely helpful when you ask this sort of question to have both your Watir code and the HTML of the page element that you are trying to manipulate. Finally, Watir is a little ambiguous sometimes about what it considers a button and what it considers a link. If ie.link(:text, Cancel).click doesn't work, try ie.button(:text, Cancel).click ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] I am a newb
When buttons all have the same names and id etc, you will need to use $ie.button(:index, x).click where x is the 1-based index of the button you want to click (from the top down). So if there are 3 cancel buttons on the page and you want to click the 2nd one then your code will look like this: $ie.button(:index, 2).click There are some really good examples of just about everything you would want to do in the unittests directory installed when you install Watir. Hope this helps, --Mark -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of David Sent: Friday, September 01, 2006 9:11 AM To: wtr-general@rubyforge.org Subject: [Wtr-general] I am a newb Ok so I just started using ruby and watir, when I say just started I mean no programming experience. The company I work for has me using/learning Watir. I can't make it click a button. I can make it click other buttons though. The software we developed doesnt use buttons per say, but something using href's and that such. I was wondering when you tell watir to ie.link(:text, Cancel).click , does it search the page source for just cancel? We have several so-called buttons named cancel. Does watir just hit the first cancel? If so how do I make it hit this specific cancel? Any thought are much appreciated. - Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=3917messageID=10762#10762 ___ 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] I am a newb
GUI testers: David has asked how to start using Watir to drive a website and test it. To the David: Read a book about Ruby ASAP! To the Ruby users: Where's the nearest ProgrammingRuby.chm for the OP? Does Watir come with it? Next topic: If anyone here uses the TFUI reveal() technique, could they describe it in Watir terms? to wtr-general@rubyforge.org ? Using it will give this Watir initiate more propulsion than a capture/playback system! -- Phlip http://c2.com/cgi/wiki?ZeekLand -- NOT a blog!! ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] I am a newb
On 01/09/06, Phlip [EMAIL PROTECTED] wrote: To the Ruby users: Where's the nearest ProgrammingRuby.chm for the OP?Does Watir come with it?Should be installed with Ruby itself. On my hard drive, I found a copy located in the /ruby/doc folder. ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] I am a newb
Paul Carvalho wrote: Should be installed with Ruby itself. On my hard drive, I found a copy located in the /ruby/doc folder. Ouch right just found it: C:/ruby/doc/ProgrammingRuby.chm I gave up too soon. -- Phlip http://c2.com/cgi/wiki?ZeekLand -- NOT a blog!! ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] I am a newb
I want to say thanks to everyone, I am trying to understand. With the $ie.button(:index, 2).click command how does it know that it is looking for Cancel. This is the html source I am trying to pull from: a class=right button id=sessionDialogCancel href=JavaScript:hideSessionDialog();Cancel/a I have exhausted all of my ideas, I havent tried to do the $ie.button(:index, 2) command yet. I am going to buy a book on Ruby, but college textbooks come first. - Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=3917messageID=10774#10774 ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] I am a newb
Using :index it doesn't. What it is doing if finding the Xth button from the top of the page (you could count them from view source). I have to use this quite often in the applications I test because of auto-generated page elements which use the same button attributes (id, name, and values) for all similar buttons on the page. For instance, there could be 100 rows of data all with the same 'Add', 'Edit', and 'Delete' buttons. Using the button index is the only way of finding a particular button on the page. --Mark -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of David Sent: Friday, September 01, 2006 11:20 AM To: wtr-general@rubyforge.org Subject: Re: [Wtr-general] I am a newb I want to say thanks to everyone, I am trying to understand. With the $ie.button(:index, 2).click command how does it know that it is looking for Cancel. This is the html source I am trying to pull from: a class=right button id=sessionDialogCancel href=JavaScript:hideSessionDialog();Cancel/a I have exhausted all of my ideas, I havent tried to do the $ie.button(:index, 2) command yet. I am going to buy a book on Ruby, but college textbooks come first. - Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=3917messageID=10774#10774 ___ 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] I am a newb
On 9/1/06, David [EMAIL PROTECTED] wrote: I want to say thanks to everyone, I am trying to understand. With the $ie.button(:index, 2).click command how does it know that it is looking for Cancel. This is the html source I am trying to pull from:a class=right button id=sessionDialogCancel href="" Try $ie.button(:id,sessionDialogCancel).clickAlso try using the flash method to see what's happening: $ie.button(:index, 2).flash$ie.button(:index, 3).flash $ie.button(:index, 4).flash$ie.button(:index, 5).flash ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] I am a newb
this looks like a link, not a button. try ie.link(:text, 'Cancel').click or ie.link(:index, index).click where index is the 1-based number of this link in the page (as described for button using index previously) a class=right button id=sessionDialogCancel href=JavaScript:hideSessionDialog();Cancel/a The content contained in this electronic message is not intended to constitute formation of a contract binding TWTC. TWTC will be contractually bound only upon execution, by an authorized officer, of a contract including agreed terms and conditions or by express application of its tariffs. This message is intended only for the use of the individual or entity to which it is addressed. If the reader of this message is not the intended recipient, or the employee or agent responsible for delivering the message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this message is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the sender of this E-Mail or by telephone. ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] I am a newb
thats a link, so ie.link(:id , "sessionDialogCancel" ).flash is what you need - Original Message - From: Chris McMahon To: wtr-general@rubyforge.org Sent: Friday, September 01, 2006 12:40 PM Subject: Re: [Wtr-general] I am a newb On 9/1/06, David [EMAIL PROTECTED] wrote: I want to say thanks to everyone, I am trying to understand. With the $ie.button(:index, 2).click command how does it know that it is looking for Cancel. This is the html source I am trying to pull from:a class="right button" id="sessionDialogCancel" href=""Cancel/a Try $ie.button(:id,"sessionDialogCancel").clickAlso try using the "flash" method to see what's happening: $ie.button(:index, 2).flash$ie.button(:index, 3).flash $ie.button(:index, 4).flash$ie.button(:index, 5).flash ___Wtr-general mailing listWtr-general@rubyforge.orghttp://rubyforge.org/mailman/listinfo/wtr-general ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] I am a newb
Apparently I need more help than thought. I have tried all of the ideas every one has given me(thank you). I am still unclear on how to use index or flash method. The button or link I am trying to get to, I have done many others just like it, but for some reason I cant get it to press cancel this time. I have been using ie.link(:text, Export Data).click format, but I figure the one I am trying to do watir is grabbing one of the first Cancel's in the source. In the ruby prompt, it will go through and act like everything went smoothly. It is laid out the same way as others, but I dont know. - Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=3917messageID=10779#10779 ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] I am a newb
Try this. Bring up a command prompt and type irb (this is the interactive Ruby shell)and type the following commands. (instead of http://google.com, though, type in the address of your page. Do you see your link in the output from ie.show_links? If you send that to the list, we might be able to make more headway. C:\Documents and Settings\cmcmahonirbirb(main):001:0 require 'watir'= falseirb(main):002:0 include Watir = Objectirb(main):003:0 ie = IE.new= #Watir::IE:0x2e9ab18 @enable_spinner=false, @empty_tag_name=DUMMY, @speed=:slow, @ole_object=nil, @url_list=[], @defaultSleepTime=0.1, @logger=#Watir::DefaultLogger:0x2e9aa58 @progname=nil, @logd ev=#Logger::LogDevice:0x2e9a9e0 @filename=nil, @mutex=#Logger::LogDevice::LogDeviceMutex:0x2e9a9b0@mon_entering_queue=[], @mon_count=0, @mon_owner=nil, @mon_waiting_queue=[], @dev=#IO:0x277e740, @ shift_size=nil, @shift_age=nil, @level=2, @formatter=nil, @default_formatter=#Logger::Formatter:0x2e9aa10 @datetime_format=%d-%b-%Y %H:%M:%S, @ie=#WIN32OLE:0x2e9aab8, @activeObjectHighLightColor =yellow, @error_checkers=[#Proc:[EMAIL PROTECTED]:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.0.945/./watir.rb:1176], @typingspeed=0.08irb(main):004:0 ie.goto( http://google.com)= 6.891irb(main):005:0 ie.show_linksOn 9/1/06, David [EMAIL PROTECTED] wrote:Apparently I need more help than thought. I have tried all of the ideas every one has given me(thank you). I am still unclear on how to use index or flash method. The button or link I am trying to get to, I have done many others just like it, but for some reason I cant get it to press cancel this time. I have been using ie.link(:text, Export Data).click format, but I figure the one I am trying to do watir is grabbing one of the first Cancel's in the source. In the ruby prompt, it will go through and act like everything went smoothly. It is laid out the same way as others, but I dont know. -Posted via Jive Forumshttp://forums.openqa.org/thread.jspa?threadID=3917messageID=10779#10779 ___Wtr-general mailing listWtr-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] I am a newb
Attebery, Bill wrote: If you have more than one link with 'Cancel' as the text -- it probably is grabbing a different one is you use ie.link(:text, 'Cancel').click In that case you need to uniquely identify it, and may need to use the index. Try this: get the page to where this link exists open a command prompt run irb and put in the following to connect to your browser instance require 'watir' include 'Watir' ie=IE.attach(:title, /title of your browser window/) ie.show_links try to figure out which one is your link you can do ie.link(:index, index_number).flash to try to flash different ones to help you identify it, once you know the index then ie.link(:index, index_number).click should work I'd think Note that's the inverse of the reveal() technique I suggested. How would that look in Watir code? The two techniques could reinforce each other! -- Phlip http://c2.com/cgi/wiki?ZeekLand -- NOT a blog!! ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] I am a newb
bring up a CMD shell; type irb; you;ll get a prompt like irb(main):001:0then issue the commands noted above.On 9/1/06, David [EMAIL PROTECTED] wrote: I dont know how to pull up irb, i know how to get into ruby though. I think the real programmer that helped me set up ruby and watir didnt follow all the directions, and we just kinda winged it. I am still a little lost. If it helps I could throw up all the source code for everyone to see. -Posted via Jive Forumshttp://forums.openqa.org/thread.jspa?threadID=3917messageID=10783#10783 ___Wtr-general mailing listWtr-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] I am a newb
David, sometimes these people forget what it is like to be a newb, and give you specific information might be helpful *IF* you had a context in which to put it. From what you say, it appears you need some more general information first. Watir can find elements on a page in a variety of ways. Among these are :name, :id, :index, and :text. Which is more appropriate depends on your specific use. As somebody mentioned, you should use :id when you can... but this presumes that the designer of the page used element ids properly. That is to say, in a well-formed page every element should have a unique id. Keep that in mind when designing your own pages. Sometimes you will encounter a page with elements that do not have an id, but do have a name. Then you are forced to use name instead, but name (according to the rules) is not required to be unique. If you have neither name or id, then you might have to fall back to using :index or even :text. In this particular case the type of element you are trying to click is a link, and it has an id. So you probably want to do $ie.link(:id, 'sessionDialogCancel').click However, I will caution you that it is usually not a good idea to use global variables like $ie. In the vast majority of cases, you will want to use an instance variable instead, which uses the @ sign. So rather than $ie you would have @ie. Lonny Eachus == ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general