tags:

views:

92

answers:

3

I've below code which basically clicks on a Click event present a table,

browser.Frame("f").Element("Table1").Click();

it works properly when during debug mode (like if i put a break point and execute it). But, it does not work when i run it in a flow, I've used SimpleTimer to wait until Settings.WaitForCompleteTimeOut, but no use.

Any help?

A: 

WatiN WaitForCompleteTimeOut method either waits untill some predicate has been fullfilled or the input time has run out. If you're trying to wait for a while before continuing using Thread.sleep(int time) would be a better solution. Though you could of courseset a predicate to the Settings.WaitForCompleteTimeOut method that will never be fulfilled so the timeout will always be reached.

If you are trying to wait untill an operation is finished you should just forget about the Settings.WaitForCompleteTimeOut method. It is run after every WatiN command, so you don't have to.

Dadle
+1  A: 

Maybe you have a timing problem...

Try to check if the element exist before you click on it.

 browser.Frame("f").Element("Table1").Exists

And then perform your operation...

alonp
A: 

Had the same issue. Fixed by turning off "IE Enhanced Security Configuration".

How to turn off IE enhanced security configuration

Pavlo Neyman