Forum Discussion
Thanks for the replay.
In that case how can I get properties of some child object created by FindChildByXPath with xpath. For example,
if I have multple dom with a class name in the dom, I need to check the some properties inside object with xpath
<ul> <li class = "some Class"> <span class = "some calss2"> text </span> </li> <li> ... </li> ... </ul>
now I am creating object by using //li[@class='val']
In case if I need use childobject, of //span[@class='val'] in each object, how can I do the same with Testcomplete tool
Hi,
HTML markup provided by you is very poor one because it does not contain any stable unique identifier.
If you really need to work with web pages that generate markup like you've provided, then you may do it this way:
-- Check if the found object is TestComplete wrapping one. This can be done using the code like this:
if (aqObject.IsSupported(<object>, 'Exists')) then // this is TestComplete object
-- If the found object is TestComplete wrapping one, you may use methods provided by TestComplete (like you tried);
-- If the found object appeared to be native DOM one, then you should use native DOM functions like selectSingleNode(), selectNodes(), etc. and continue to work with the found child objects as with native DOM objects.
https://docs.microsoft.com/en-us/previous-versions/windows/desktop/ms757828%28v%3dvs.85%29
https://docs.microsoft.com/en-us/previous-versions/windows/desktop/ms764730(v=vs.85)
https://stackoverflow.com/questions/16016521/how-do-i-select-child-elements-of-any-depth-using-xpath
Related Content
- 5 years ago
- 5 years ago
Recent Discussions
- 2 days ago