0

I am trying to simulate the click event of an anchor tag using watij on mac. I found the tag

<a name="myLink" href="" onClick=""></a>

My code is

Tag link = spec.jquery("a[name=myLink]").click();

But it does not seem to work. Please help.

Thanks & Regards, Ankur Agrawal

agrawalankur
  • 309
  • 2
  • 3
  • 15

1 Answers1

0

You might try altering your reference to the link. Ex., referencing it by id or class, as shown here:

<a href="" class="my_link">Hello</a>

-

Tag link = spec.jquery("a.my_link").click();

Additionally, although I am not familiar with Watij, at this point in the code, are you positive that the <a> element has finished loading? You need to verify that all elements in the DOM have loaded before you simulate actions against them.

element119
  • 7,475
  • 8
  • 51
  • 74