Forum Discussion

jacobstore's avatar
jacobstore
Occasional Contributor
2 years ago

How can I obtain current browser in scripts?

I use TestComplete with BitBar to test web applications. My tests are scripted in javascript and I start remote browser like this:

 

var capabilities = {
"platform": "Windows",
"osVersion": "11",
"browserName": "Chrome",
"version": "109",
"resolution": "1920x1080"
};
var server = "https://eu-desktop-hub.bitbar.com/wd/hub";

 

function StartInBitBar() {
    Browsers.RemoteItem(server, capabilities).Run("");

}

 

function DoSomeTests() {

//Here I need to obtain the Remote browser item created in StartInBitBar(), but how?

//This fails:

   Log.Message(Browsers.CurrentBrowser.Description);

}