hello
whihc field you want to test? just browser.text will get all the texts in
the page? however i thing i got the point you want check if the words
appears.
.should is include in the rspec.
you can try with
irb:
require "watir-webdriver"
b = Watir::Browser.new
b.goto "www.google.com"
puts b.text.include?("Amazon.com") || b.text.include?("Conditions")
should return true.
Em quarta-feira, 14 de agosto de 2013 07h56min36s UTC-3, watir webdriver
escreveu:
>
> In watir-webdriver, is it possible to verify text using OR statement in a
> child window?
>
> and should fail if its anything other than 'best' or 'catalog'
>
> *My step definition is as below :*
>
> * Then /^I should see either "best | catalog" on the page$/ do
> @browser.window(:title => "child").use do
>
> puts @browser.text.should == 'best' || @browser.text.should == 'catalog'
>
> @browser.window(:title => "child").close
> end
> end*
>
> Its printing all the text from the parent window and failing...Here I just
> have to verify if either of the text is present in the child window or not
> and if it exists return 'true'
>
> Any thoughts please?
>
> Thanks in-advance.
>
>
>
>
--
--
Before posting, please read http://watir.com/support. In short: search before
you ask, be nice.
[email protected]
http://groups.google.com/group/watir-general
[email protected]
---
You received this message because you are subscribed to the Google Groups
"Watir General" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.