I do something like this if I want to see an element or text is present or 
not

`expect(@browser.div(id: language-selection, visible_text: 
'English').present?).to be true` (or false)    

I also learned if you add the class id or name, it goes much more quickly 
instead of just visible_text.

Hope that helps.

On Wednesday, June 13, 2018 at 10:40:40 AM UTC-7, christina wrote:
>
> Hi all!
>
> This should be so simple but not sure why it fails.
>
> I have this
>
> @browser.text.include? "English"
>
>
> and it returns fals. This is correct. Can one help me how do I do an 
> assertion to pass or fail?
>
> I try:
>
>
> expect(@browser.text.include?("English")).to be false
>
>
>
> But at run I get
>  Then English French Language Option should not show
>       undefined method `expect' for #<Watir::Browser:0x00000000042d7040>
>       Did you mean?  exec (NoMethodError)
>       ./features/support/pages/loginClientPage.rb:13:in 
> `login_language_option_not_exist'
>       ./features/step_definitions/clientSteps.rb:13:in `/^English French 
> Language Option should not show$/'
>       features/features/client.feature:6:in `Then English French Language 
> Option should not show'
>
> Thank you!
>
>

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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/d/optout.

Reply via email to