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
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
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
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
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
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-
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
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
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
___
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
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
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
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]
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
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
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
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:
> > > 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
> 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
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
> 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
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
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
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 ,
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
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
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
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
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
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
30 matches
Mail list logo