Forum Discussion

coffee's avatar
coffee
Contributor
8 years ago
Solved

Exploring the DOM - Finding ChildNodes

Hi,   I am very very new in TestComplete. Just trying the product.   I am wondering, can TestComplete explore the DOM and find the Child Nodes ?   E.g. in Javascript we can write this to find s...
  • Colin_McCrae's avatar
    8 years ago

    When you record a Click, it takes in the co-ordinates (relative to the control it's applying the click to).

     

    But in most cases, they're not required and you can just remove them. In the above example, try changing it to plain old "Click()" and it should still work just fine. Personally, I write all my scripts from scratch. Converted recordings are OK, but generally need at least some tweaking to make them more flexible/useful and tidy up some of the extra stuff you often get from auto-generated scripts (such as click co-coordinates) which you don't really need.

     

    If you want to explore the DOM, look at the tabs at the bottom of your project area, there should be an "Object Browser" tab. Click that (with your site or application open) and it will show you the entire structure, as TestComplete see's it. On top of that, there are plenty of "Find" type options including XPath and CSS Selector type options similar to Selenium (for web based tests). Similarly, you can start with the object spy on a specific object and then jump to it in the main Object Explorer in TC. (Top right button in the object spy once you select an object)