English 中文(简体)
Wait UntilExists()方法
原标题:WaitUntilExists() method call
  • 时间:2012-04-10 11:29:06
  •  标签:
  • watin

我是WatiN的相对新鲜事物,但我想到以下几行会奏效:

WebBrowser.Current.Table("grid").FindRow(value, columnNum).WaitUntilExists();

目前它没有以下例外:

System.NullReferenceException: Object reference not set to an instance of an object.

我猜测的是,这段话语在茶叶运行时没有有人居住,因此FindRow是一纸空文。

我将这一行文改为:

while (WebBrowser.Current.Table("grid").FindRow(value, columnNum) == null){}

这种办法可行,但更倾向于在建筑方法中使用WatiN(有时间)。

关于如何确定我第一行的法典的想法? 感谢!

问题回答

Well, WaitUntilExits() is different than WaitUntilIsNotNull ( which isn t a method :D ) You can probably use

WebBrowser.Current.Table("grid").FindRow(value, columnNum).WaitForComplete() 

WebBrowser.Current.Table("grid").FindRow(value, columnNum).WaitUntilExists() 

WebBrowser.Current.Table("grid").FindRow(value, columnNum).WaitUntil(attribute, value) 

取决于你们的需要





相关问题
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 ...

热门标签