On 15 May 2012 09:40, Srinivas <[email protected]> wrote:

> I tried to click an div tag element using its class name in Firefox
> browser and it was not triggered.
>
> The command i used is: br.div(:class, "upload").click, actually it
> executes the statement, but action was not happened and I have also
> not getting any error as well.
>
> I have also tried the following commands to locate the same object and
> I am succeed as well:
>
> br.div(:class, "upload").flash
>
> br.div(:class, "upload").present?
>
> Note: This problem happens only in Firefox, whereas in Google Chrome
> same code working fine.
>
> could anyone help me on this regard?
>
> Thanks Sarosini
>
>
It could be a timing issue. Maybe the javascript needed to trigger whatever
action you expect had not been loaded when Watir clicks on the element.

Just for the sake of testing, try adding a 'sleep(10)' before the click
action and test it.

if it works, then try to find a more appropriate way to wait for the page
to be ready, like waiting until a particular element is present. This kind
of problem is very common when testing ajax-enabled applications.

- cassiano

-- 
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]

Reply via email to