azakharov
12 years agoContributor
Any plans for TR html elements support?
Hi, Are there any plans on supporting table row html elements in object explorer? For example: <tr id="someRow" class="dataRow selected" desc="some description"> I see it in Fi...
- 12 years agoHi Andrey,
You don't see the TR nodes as you seem to use the Tree model for Web applications. You could change it to, say, the Tag model - the table (TR, TD, TH) nodes will be displayed in this case in the object tree. However, you won't be able to perform the cross-browser testing with this model.
As you want to check if the page contains the HTML element with the specified attribute, I would suggest that you used the EvaluateXPath method. It searches through HTML elements by using the specified XPath expression. Refer to the "Finding Web Objects Using XPath Expressions" article for more information.
For example, here is how the code may look in your case:
//JScript
var table = //obtain the table object
table.EvaluateXPath("//TR[@id='someRow']")
if (tmp != null)
{
var arr = (new VBArray(tmp)).toArray();
// do something
}
else
{
// If nothing was found, post a message to the log
Log.Error("Nothing was found.");
}