jeffrey_crowley
11 years agoContributor
querySelectorAll not working in IE8 from TestComplete 9.31
Here's some sample code that I'm using that fails on the querySelectorAll line with the following message: "Object doesn't support this property or method"
function Test()
{
var page = Sys.Browser("iexplore").Page("*");
page.Wait();
var str = page.contentDocument.querySelectorAll("span.logo-main-a")[0].innerHTML;
Log.Message(str);
}
The code above works on IE9/10, FF, and Chrome. When I take the simplified line below and execute it in the IE8 dev tools, it works fine.
document.querySelectorAll("span.logo-main-a")[0].innerHTML;
I thought it might be something to do with contentDocument or maybe nothing was working so I tried:
page.contentDocument.getElementById("lpbuttondiv").innerText
and that worked fine.
So what am I missing?
function Test()
{
var page = Sys.Browser("iexplore").Page("*");
page.Wait();
var str = page.contentDocument.querySelectorAll("span.logo-main-a")[0].innerHTML;
Log.Message(str);
}
The code above works on IE9/10, FF, and Chrome. When I take the simplified line below and execute it in the IE8 dev tools, it works fine.
document.querySelectorAll("span.logo-main-a")[0].innerHTML;
I thought it might be something to do with contentDocument or maybe nothing was working so I tried:
page.contentDocument.getElementById("lpbuttondiv").innerText
and that worked fine.
So what am I missing?
Hi Jeff,
In the TestComplete documentation, it's said that the QuerySelectorAll method isn't supported only in IE 7. It looks like our R&D team should investigate how the method works in IE 8. Could you please submit a support ticket to our Support team for this?
As for the script formatting, you can use the code BBcode.