Forum Discussion
dale_waterworth
11 years agoOccasional Contributor
Just use xpath - it's much simpler:
you can say something like this psuedo
//create your xpath
var xpath = "//*//div/a";
//pass it into the evaluate xpath function where page is the browser object
var elements = page.EvaluateXPath(xPath);
for each 'a' element
//do test
this is cleaner, simpler and less of a headache.
Once your familiar with it you can just create a function to evaluate any xpath and return your array of results.
you can say something like this psuedo
//create your xpath
var xpath = "//*//div/a";
//pass it into the evaluate xpath function where page is the browser object
var elements = page.EvaluateXPath(xPath);
for each 'a' element
//do test
this is cleaner, simpler and less of a headache.
Once your familiar with it you can just create a function to evaluate any xpath and return your array of results.