Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I access a DOM object with Selenium?

I am coming from a QuickTest Pro background where I can get to any element's DOM object with the .object method. I want to know what the equivalent is in Selenium RC.

like image 685
paperhat Avatar asked Feb 01 '26 08:02

paperhat


1 Answers

Sure you can. The real question is: what do you want to do with it? Check out the getEval() command. It can evaluate any JavaScript and return the result in a String format. That means you can't get the full DOM object back in to Java/C#/perl/etc, but you can get back attributes of it (ie: innerHTML, etc).

like image 196
Patrick Lightbody Avatar answered Feb 02 '26 23:02

Patrick Lightbody



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!