Forum Discussion

eladg's avatar
eladg
New Contributor
15 years ago

Is XPath Supported in TestComplete Web Testing?

Hi!


  • I am new to Web Testing in TestComplete, and I wanted to know if XPath expressions can be used to locate elements on a web page, like it is possible to do with other web testing automation tools (Selenium, for example).



  • If not, is the Page.NativeWebObject.Find the recommended method to locate those 'hard-to-get' web page elements?



  • Is XPath planned to be suppurted in the future?


Thanks :-) 

  • With Xpath unavailable I just using the FindChild method , and treat the contained of the whatever ur looking for as the object: my example for you looks like this:



    while (Page.FindChild("idStr", "bodyContent", 1000, true).Exists == false) { aqUtils.Delay(100);}


        var vaaoa = Page.FindChild("idStr", "objectID", 1000, true);


        vaaoa.FindChild("idStr", "objectID*", 1000, false).Click();



    hope this helps

  • Hi,



    If you want to use XPath to access a page element, there is no way to do this. You can just use it with XHTML-compliant HTML code (that can be parsed with the MSXML parser) to get a particular HTML node, not the corresponding page element.



    In this case, I recommend that you use one of the approaches mentioned in the Finding Objects on Web Pages help topic.



    Is XPath planned to be suppurted in the future?


    We have an appropriate suggestion in our database, and your request has increased its rating.