I have been curious to know as to how do they incorporate Xpath in QTP code for hitting an object on the UI.
So, for a normal text box on the web page which doesnt have any properties for us to create a desc. how can we possibly tackle such a scenario and hit the control.
Can we achieve it through Xpath?If yes,then how?
Refer the exercise in the help file.
HP QuickTest Professional Add-ins Guide > Overview > Testing Web-Based Applications > Understanding Web Object Identifiers > How to Use Web Object Identifiers - Exercise
Thanks for the valuable inputs, but this is more of the OR approach. Now lemme understand the DP way, can we have something like B().P().WebEdit("name:??") how can we tell qtp that this is Xpath driven. Do we have something like Regular Expression = true
Set oDesc = Description..Create()
oDesc.Xpath = True
I am thinkig on the lines of oDesc.RegularExpression = True
Is the xpath identification available only from qtp 11 onwards? Cant the navigation part to an element node be done via DOM itself then where exactly comes the scenario when we are dependent on the xpath approach?
I think the Xpath approach is quicker than DOM also comes handy when we have complex dynamically changing property something like "ABCD_X4de" and the next time it is "ABCD_fr433". Also when there are CSS based property value. Please correct me experts