3
votes

I'm trying to access a field by the display name that is a link, something like this:

<a class="node" href="javascript: MCMenu(7);">MÓVEL</a>

and trying to access the item by doing this:

t= $browser.link(:text => "MÓVEL").exists?

t.click

the error is:

unable to locate element, using {:text=>"M\303\223VEL", :tag_name=>"a"} (Watir::Exception::UnknownObjectException)

1
What version of Ruby and Watir-WebDriver do you use? I just checked and it works fine for me. - p0deje
Have you tried using the other set of quotes? I.e. 'movel' instead of "movel" ? - anonygoose
I'm using watir-webdriver (0.5.2, 0.4.1, 0.3.9) and ruby ruby 1.8.7 - macwadu
with the change of the quotes didnt work too - macwadu
i have uninstaled the 0.41 and 0.39 now i only have the 0.52 but it does the same - macwadu

1 Answers

3
votes

Try it with a regex like this:

t = $browser.link(:text => /M.VEL/).exists?