I'm using watin and nunit in my project and I would like to know is there any way to find whether a textbox is present in a webpage or not I tried the following code but its not working

if (browser.TextField(Find.ById("textbox1")) != null)
{
return true;
}
else
{
return false;
}

So how can i check whether a textbox is present or not in a webpage using watin???

有帮助吗?

解决方案

bool isThere = browser.TextField(Find.ById("textbox1")).Exists;
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top