vthomeschoolmom
5 years agoSuper Contributor
Really TR not supported in Firefox and Chrome? Do I understand this correctly
Consider this code: // Select desired cell. If not already selected, click it. (If
// it is already selected do not click as clicking will de-select.)
// Row objects are not present for FF and Ch...
- 5 years ago
Hi vthomeschoolmom,
I see that you are working with the Support team on this question. Let me post their reply here:
Hi Stephanie,
Thank you for creating this case. In TestComplete, you can access the HTML DOM document object of web pages, by using the contentDocument property of the page. You can also use contentDocument.Script property of the page to execute scrips on web pages.
To obtain the class of a TR tag in Chrome/Firefox, you can utilize the JavaScript method(s): querySelector or getElementsByClassName to obtain the TR tag object and then locate the className property afterwards. See below for a sample TestComplete script:
function queryTR() {
var page = Sys.Browser("chrome").Page("*");
var className = page.contentDocument.Script.eval('document.getElementsByClassName("parent")[0].children[0].children[1].className');
Log.Message(className);
}
Refer to the following documentation regarding running JavaScript on web pages using TestComplete:
Executing JavaScript on Web Pages: https://support.smartbear.com/testcomplete/docs/app-testing/web/general/common-tasks/javascript.html
Accessing DOM document Object: https://support.smartbear.com/testcomplete/docs/app-testing/web/general/common-tasks/document-object.html
Let me know if you have any questions.