How to check whether a textbox is present in a webpage or not using watin

StackOverflow https://stackoverflow.com/questions/17826536

  •  04-06-2022
  •  | 
  •  

Pregunta

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

¿Fue útil?

Solución

bool isThere = browser.TextField(Find.ById("textbox1")).Exists;
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top