Hi i want to get browser name in the onPrepare function,
I used the below code.
browser.getCapabilities().then((c) => {
c.get('browserName');
});
the code writes the browser name properly on the console if i use:
browser.getCapabilities().then((c) => {
console.log(c.get('browserName'));
});
But i gets 'undefined' on, return , set to a variable or set to browser.browserName. Could someone help me here
I tried below three methods:
var a;
browser.getCapabilities().then((c) => {
a= c.get('browserName');
});
var a= browser.getCapabilities().then((c) => {
return c.get('browserName');
});
global.a;
browser.getCapabilities().then((c) => {
global.a= c.get('browserName');
});