How to identify an object uniquely in web-table
I am using DOM model for web-testing.I need to identify an object that it is associated correctly to a particular report.The problem is that if it is present on web-page associated with different report,its hard to verify its association with one particular report.
In the screenshot,I want to verify that the object with rejected status(circled red) is associated with report "test5" but it is also associated with another report "ABC3",so script code is not able to make out if it is associated correctly or not.How to uniquely identify it that it is associated with "test5".
I used the code like this:
report = page.NAtiveWebObject.Fin("innerText","test5 ","A");
status = report.parent.FindChild("title","rejected");
Log.Error("There is some error","",pmNormal,Attr);
The problem is that if the status is not rejected for "test5" but is rejected for another report "test4",it still returns true by seeing the status of the other report.
I am using DOM model and all my scripts are built using that only.
Re: How to identify an object uniquely in web-table
The easiest way to do this is to enable the Hybrid model. In this case, you can obtain the needed report in the way it is recognized in the Tree model and use its Find method to verify whether it contains the needed object.
The rest of your script will run without any modifications since Hybrid includes both DOM and Tree.