English 中文(简体)
Watin: Clicking on a element works in debug mode but not otherwise
原标题:
  • 时间:2009-11-19 07:54:42
  •  标签:
  • watin

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?

问题回答

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

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

How to turn off IE enhanced security configuration

WatiN WaitForCompleteTimeOut method either waits until some predicate has been fulfilled 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 course set 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 until 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.

Actions actions = new Actions(driver);
actions.moveToElement(webElement);
actions.click();
actions.sendKeys(Keys.RETURN));
actions.build().perform();




相关问题
Hide all windows for a process (ex. Internet Explorer)

I am using WatiN to script actions in Internet Explorer that run in the background of the user s machine. (I know...hacky). I am able through WatiN to make the Internet Explorer window not show. ...

WatiN - getting past the certificate error page

Anyone know how to use CertificateWarningHandler in WatiN? I ve got as far as... IE ie = new IE("https://mysite.aspx"); CertificateWarningHandler cwh = new CertificateWarningHandler(...

Running automated Web browser tests under Hudson

I m running Hudson for my automated builds and love it. I d now like to create automated Web browser tests using either WaTiN (preferred) or Selenium. As my Hudson runs as a Windows service (under ...

Can WatiN disable JavaScript in IE?

I want WatiN to disable JavaScript for some of my tests but can t find any obvious way to do it. Is it possible? I am using IE specifically. Thanks in advance, Ciaran

What is the best way to crawl a login based sites?

I ve to automate a file download activity from a website (similar to, let s say, yahoomail.com). To reach a page which has this file download link, i ve to login, jump from page to page to provide ...

热门标签