I'd recommend to use #present? instead, because #visible? will throw an error if element does not exist.
In short: #exists? - means that element has to exist on the page, does not matter if it is visible or not #visible? - means that element is visible on the page. Raises an error if element does not exist. #present? - means that element has to exist on the page and is visible. Jarmo Pertman ----- IT does really matter - http://itreallymatters.net On Thursday, September 6, 2012 9:19:09 PM UTC+3, Daniela wrote: > > Hi Joe, > > Thank you a lot! > > It work's for me! > > Daniela > > Em quinta-feira, 6 de setembro de 2012 15h13min42s UTC-3, Joe Fl escreveu: >> >> Hi Daniela, >> >> You can do the following: >> >> browser.a(:text,'Adicionar mídia').visible? >> >> Joe >> >> On Thu, Sep 6, 2012 at 12:56 PM, Oscar Rieken <[email protected]> wrote: >> > well you can first locate the element and then there a few different >> ways >> > to check if the element exists? >> > >> http://watir.github.com/watir-webdriver/doc/Watir/Element.html#exists%3F-instance_method >> >> > >> > >> > On Thu, Sep 6, 2012 at 12:48 PM, Daniela <[email protected]> >> wrote: >> >> >> >> Hi.. >> >> >> >> Please, how can i verify if an object appears on a page? .. for >> example, >> >> look at this html: >> >> >> >> <a class="thumbnail-new add_related_contents" href="#">Adicionar >> mídia</a> >> >> >> >> I want to verify if the link "Adicionar mídia" is in the page. >> >> >> >> How can i do this? >> >> >> >> Thanks! >> >> >> >> -- >> >> 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] >> > >> > >> > -- >> > 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] >> > -- 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]
