I am having trouble with a function that is supposed to return a string but instead, it returns an object. Unfortunately, I cannot use the .toString() method either.
currentEnvironment: string = "beta";
serverURL: string = this.setServerURL(this.currentEnvironment);
URL: string = this.serverURL;
async setServerURL(env: string): Promise<string> {
const myText: string = 'https://abcqwer.com';
return myText;
}
async login(): Promise<void> {
console.log('The Login URL is: ' + this.URL.toString());
await browser.get(this.URL);
};
An error message appears saying:
Error: Parameter "url" must be a string, not an object