Re: [Wtr-general] Tricky checkbox selection

2006-01-23 Thread Angrez Singh
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 containing text Test3 (this is what y

Re: [Wtr-general] Tricky checkbox selection

2006-01-23 Thread Sergio Pinon
Title: Tricky checkbox selection That is close. You can’t access the class attribute using class. You have to use className. But other than that yes you are right. Glad to here it worked out.   Sergio   From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paatsch, Bern

Re: [Wtr-general] Tricky checkbox selection

2006-01-23 Thread Sergio Pinon
Title: Tricky checkbox selection The other thing you can try to do is use the outerHTML properyt which will show you the whole HTML tag. So you would do the following:    puts variable.each{|i| print i.outerHTML, "\n"}   Sergio   From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTE

Re: [Wtr-general] Tricky checkbox selection

2006-01-23 Thread Paatsch, Bernd
Title: Tricky checkbox selection It works.   In order to see the whole input tag element and its attributes I have to write something like    puts variable.each{|i| print i.class, i.name, i.value, "\n"}   Is this correct? From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Serg

Re: [Wtr-general] Tricky checkbox selection

2006-01-23 Thread Sergio Pinon
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 p

Re: [Wtr-general] Tricky checkbox selection

2006-01-23 Thread Sergio Pinon
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-

Re: [Wtr-general] Tricky checkbox selection

2006-01-23 Thread Paatsch, Bernd
Title: 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: ### etc. which I believe represents memory locations? Ho

Re: [Wtr-general] Tricky checkbox selection

2006-01-23 Thread Paatsch, Bernd
Title: Tricky checkbox selection "Add_member[]" is not replaced by something. The code below is exactly as I see it. From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Cain, MarkSent: Monday, January 23, 2006 2:07 PMTo: wtr-general@rubyforge.orgSubject: Re: [Wtr-general] Tricky

[Wtr-general] Getting rid of security alert no problem, but how do I detect this happening?

2006-01-23 Thread Jon Passmore
How do I code so that if a security alert ever pops up it will be detected so I can close it?  I had the question about how to close the security alert box answered earlier and I thank those who helped.  Now I just need to figure out this last piece if anyone can help.Thanks.Jon ___

Re: [Wtr-general] Tricky checkbox selection

2006-01-23 Thread Paatsch, Bernd
Title: 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 P

Re: [Wtr-general] Tricky checkbox selection

2006-01-23 Thread Cain, Mark
Title: Tricky checkbox selection When you do a view source on your page do these look this this:         Test1         Test2         Test3 Or has “Add_member[]” been replaced with something?   --Mark   From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Beha

Re: [Wtr-general] Tricky checkbox selection

2006-01-23 Thread Sergio Pinon
Title: 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-ge

Re: [Wtr-general] Tricky checkbox selection

2006-01-23 Thread Paatsch, Bernd
Title: 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 stays the same, e.g "Test1", "Test2", "Test3"           Test1         Test2         Test3 From: [EMAIL PROTECTED]

Re: [Wtr-general] Tricky checkbox selection

2006-01-23 Thread Cain, Mark
Title: Tricky checkbox selection You don’t 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 runtime—although it does get tricky when attribute na

Re: [Wtr-general] Tricky checkbox selection

2006-01-23 Thread Sergio Pinon
Title: Tricky checkbox selection That code I sent you does it already for you. When you call the getDocument() method it does it. Did you try the code and see if it works?   Sergio   From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paatsch, Bernd Sent: Monday, Janu

Re: [Wtr-general] Random number generation.

2006-01-23 Thread Michael Bolton
Hey!   Someone worked hard on String::rjust()!  Put it to good use!  :)   ---Michael B. From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sergio PinonSent: January 23, 2006 2:57 PMTo: wtr-general@rubyforge.orgSubject: Re: [Wtr-general] Random number generation. I don’t know

Re: [Wtr-general] Tricky checkbox selection

2006-01-23 Thread Paatsch, Bernd
Title: 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 PinonSent: Monday, January 23, 2006 11:12 AMTo: wtr-general@rubyforge.orgSubject:

Re: [Wtr-general] Access denied problem is driving me nuts

2006-01-23 Thread Chris McMahon
> > > 2. Why does placing an entry in my hosts file make my "access denied" > > > problems go away? > > > > > > Cross-site scripting is when when scripts from one site try to access > content from another. Today's browsers prevent this from happening. Watir > runs into to the same barriers when y

Re: [Wtr-general] Random number generation.

2006-01-23 Thread Michael Bolton
 > Can I use method names 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 i

Re: [Wtr-general] Random number generation.

2006-01-23 Thread Sergio Pinon
I don’t 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

Re: [Wtr-general] Random number generation.

2006-01-23 Thread Chris McMahon
> but do I need to precede every method name with > "test"? Yes. That's how test/unit works. > Secondly, I am trying to generate test users for my test by generating a > random number and the concatenating that number to a string "test" so that > the result is "test12345", for example. > > I'm us

[Wtr-general] Random number generation.

2006-01-23 Thread David.J.Solis
I have 2 questions:   Can I use method names 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

Re: [Wtr-general] Tricky checkbox selection

2006-01-23 Thread Sergio Pinon
Title: 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 u

Re: [Wtr-general] Tricky checkbox selection

2006-01-23 Thread Cain, Mark
Title: Tricky checkbox selection When you installed Watir, the API doc was also installed.  This is straight from that doc:   checkbox(how, what=nil ,value=nil) This is the main method for accessing a check box. Usually an HTML tag.  *  how   - symbol - how we access the check box ,

Re: [Wtr-general] Tricky checkbox selection

2006-01-23 Thread Paatsch, Bernd
Title: Tricky checkbox selection Unfortunately I do not know the value beforehand. From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sergio PinonSent: Monday, January 23, 2006 10:45 AMTo: wtr-general@rubyforge.orgSubject: Re: [Wtr-general] Tricky checkbox selection Do you k

Re: [Wtr-general] Tricky checkbox selection

2006-01-23 Thread Sergio Pinon
Title: 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 Beh

Re: [Wtr-general] Tricky checkbox selection

2006-01-23 Thread Paatsch, Bernd
Title: Tricky checkbox selection Forgot the in the html sample. From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paatsch, BerndSent: Monday, January 23, 2006 10:23 AMTo: wtr-general@rubyforge.orgSubject: [Wtr-general] Tricky checkbox selection Hello, I have following htm

[Wtr-general] Tricky checkbox selection

2006-01-23 Thread Paatsch, Bernd
Title: Tricky checkbox selection Hello, I have following html code and like to select the checkbox for "Test3". How can I do that? Test1 Subscriber208 Test2 Subscriber208 Test3 Subscriber208 Thanks. ___ Wtr-general mailing list Wtr-ge

Re: [Wtr-general] Variable Number and Type of Method Parameters?

2006-01-23 Thread Bret Pettichord
Right now Watir normally only supports a single attribute. You may want to look at Wet, which supports multiple attributes. Or, as Angrez has suggested, use xpath. BretOn 1/20/06, Andrew McFarlane <[EMAIL PROTECTED]> wrote: I am testing an application whose UI controls are often difficult tospecif

[Wtr-general] Why WindowHelper dosen't work?

2006-01-23 Thread martin xus
I write the following code: require 'watir'require 'watir/WindowHelper' test_url = "test.html"ie = Watir::IE.newie.goto(test_url) Thread.new{WindowHelper.new.push_confirm_button_ok}Thread.new(WindowHelper.new.push_alert_button) ie.close and the html as following:   WindowHelper Test   
   i