Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Member
8 Points
42 Posts
Mar 15, 2009 11:03 PM|LINK
So here is the markup:
<a class="hni_Button hnine_KioskBottomNavBtnIndexEN hnine_KioskBottomNavBtn" href="http://juniper:2107/Default.aspx?machine=NBI0EjQSNBISNBI0EjQSNA&session=Y3L3y-aj_023IS_R_Tth9w&contentid=4488001">
What I want to do it this (but instead of the Id, I want to use the classname.)
public HtmlElement IndexButton { get { return Page.Elements.Find("BtnIndex", TreatIdAs.Regex); } }
Now I know I can do this to get the classname, but it only works with the full classname, not a partial!
public virtual HtmlElement FindHtmlElementByClass(string className, string tagName, int timeoutInSeconds) { var findParams = new HtmlElementFindParams { TagName = tagName }; findParams.Attributes.Add("class", className); return Page.Elements.Find(findParams, _defaultFindTimeoutInSeconds); }
mcowan
Member
8 Points
42 Posts
How do you find elements when all you know is a part of its class?
Mar 15, 2009 11:03 PM|LINK
So here is the markup:
What I want to do it this (but instead of the Id, I want to use the classname.)
Aisle7
QA Manager (QA Lead)
michael.cowan@healthnotes.com