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

Reply via email to