Forum Discussion
rraghvani
Champion Level 3
2 days agoYour coding is correct,
function BrowserTest()
{
var browser = Sys.Browser("chrome").FindAllChildren("ObjectType", "BrowserWindow", 1);
for (var i = 0; i < browser.length; i++) {
browser[i].Activate();
/* This could be an issue*/
if (NameMapping.Sys.browser.UCLSearchPage.textboxCaseApp.Exists) {
Log.Message("Found Case App text field in MIUCL page");
} else {
Log.Message("Unable to find Case App text field on MIUCL page");
}
if (browser[i].WndCaption.indexOf("W3Schools") !== -1) {
Log.Message("Closing Browser Window " + browser[i].WndCaption);
browser[i].Close();
}
}
}
However, the main issue could be relating to the Name Mapping that you are using in the middle of the code. You are referencing browser.UCLSearchPage.textboxCaseApp, but what properties have you defined for the parent browser?
skoski191
2 days agoOccasional Visitor
Hello, this is the name mapping parent for that object:
- rraghvani2 days ago
Champion Level 3
You're using wildcards in your URL, that's ok.
I forgot to mention, see https://support.smartbear.com/testcomplete/docs/app-testing/web/supported-browsers/headless.html and the supported versions for headless web browser testing, Microsoft Edge 83 - 138 (Chromium-based, 64-bit version) - this is most likely the issue.