Can you give me an example of code (generic example) that would allow
be to check if a piece of text is visible on not on the browser page?

Thanks in advance

On Nov 12, 5:38 pm, Ethan <[email protected]> wrote:
> This is incorrect. #text returns a string, not an element, and it has no
> #visible? method.
> The simplest way is if you know the container the text is on, is to get a
> reference to that container and call #visible? on that.
> checking browser.text.include?(some_string) probably won't work, because
> #text returns all text even if it's not visible.
>
> On Thu, Nov 12, 2009 at 17:16, Tiffany Fodor <[email protected]> wrote:
>
> > Ah - I didn't realize this, but you need to require it:
>
> > require 'watir/contrib/visible'
>
> > -Tiffany
>
> > On Nov 12, 3:08 pm, QAguy <[email protected]> wrote:
> > > I try something like this:
>
> > > @browser.text.visible?("Preparing to Optimize").should == false
>
> > > but I get:
>
> > > undefined method `visible?' for #<String:0x1032d3ad0>
>
> > > I'm working with Safariwatir.
>
> > > Thanks
> > > QAguy
>
> > > On Nov 12, 4:22 pm, Tiffany Fodor <[email protected]> wrote:
>
> > > > Oops, sorry - to see if text is visible, use:
>
> > > > ie.text('My Text').visible?
>
> > > > On Nov 12, 2:09 pm, QAguy <[email protected]> wrote:
>
> > > > > Does anyone have examples of assertions. For example how would I
> > > > > assert that text on a page in either visible or invisible.
>
> > > > > Thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to [email protected]
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~----------~----~----~----~------~----~------~--~---

Reply via email to