Ask a Question

How can I obtain current browser in scripts?

jacobstore
Occasional Contributor

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);

}

1 REPLY 1
Lago
Staff

Try swapping out the browser version here "version: 109" to this:

'version'
: 'latest',

cancel
Showing results for 
Search instead for 
Did you mean: