Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using WatiN ... check if an element exists?

Tags:

c#

watin

I'm using WatiN to write an automated bot for harvesting information. Is it possible to check if an element on the page exists?

like image 910
James Jeffrey Avatar asked Mar 28 '10 16:03

James Jeffrey


1 Answers

I usually the use the following:

WatiN.Core.IE window = new WatiN.Core.IE();
if (window.Elements.Exists("yourElementId")) {
// do whatever
}
like image 90
Marco M. Avatar answered Nov 07 '22 08:11

Marco M.