In the below as you can see that the browser.sleep is supposed to be executed if the client is XYZ, but still it is not getting executed.
If i put any console.log after the browser.sleep statement, that statement is getting executed (i can see the statement) but the browser.sleep is not really waiting even though how much the sleep time i increase.
Why is the browser.sleep is not working? How do i make it wait if the client XYZ?
if (testproperties.client == 'ABC'){
browser.ignoreSynchronization = false;
browser.waitForAngular();
browser.ignoreSynchronization = true;
}
else if (testproperties.client == 'XYZ'){
browser.sleep('35000');
};
Do you passing int type as parameter? Seems like it is string. Try
browser.sleep(35000)
Also check why you might need such huge browser sleep? Maybe you want browser.wait()
instead?
put await in front of browser and pass a parameter to sleep (time in ms).
await browser.sleep(5000);
Try resolving the promise.
browser.sleep(35000).then(
function(){
console.log("Waiting");
}
)
Or update protractor to the last version
npm install protractor@latest --save
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With