I used the below lines of code but i have been facing an issue.
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It only takes a minute to sign up.Sign up to join this community
The Error UnhandledPromiseRejectionWarning occurs when there were missing some system packages to be able to run the particular action, also it depends on the browser you using to perform this action
So, the question you have asked requires some more information like:
OS Platform: --?
Selenium/Protractor version: ?
few github issues are also logged for the same, have a look at their comment discussions, you might get some idea about it: https://github.com/mozilla/geckodriver/issues/1179 https://github.com/SeleniumHQ/selenium/issues/5517