Changing Web Object Model From Tests

Applies to TestComplete 12.60, last modified on September 17, 2018

TestComplete lets you dynamically change the web object model from your tests. For example, if you have legacy tests developed using the DOM model but develop new tests using the Tree model, you can set the needed model at the beginning of your test.

To set a web object model from tests, change the Options.Web.TreeModel property value. It specifies the model name as a string, for example, "Tree", "DOM" and so on. In keyword tests, you can use the Call Object Method or Run Code Snippet operation to change the property value.

JavaScript, JScript

Options.Web.TreeModel = "Tree";

Python

Options.Web.TreeModel = "Tree";

VBScript

Options.Web.TreeModel = "Tree"

DelphiScript

Options.Web.TreeModel := 'Tree';

C++Script, C#Script

Options["Web"]["TreeModel"] = "Tree";

See Also

Testing Web Applications
About Web Object Identification and Object Models

Highlight search results