18 January 2026:
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
This forum is now archived and is in read-only mode. Please continue discussions on our improved new Sahi Pro Community forum.
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
Javascript Alert - Unable To Click Ok
Hi,
I have tried searching for an answer, but I am unable to find a solution to it that works.
When I navigate to a set url I am getting prompted with the following message:
Authentication Required
A user name and password are being requested by https://xx.xx.xx.xx. The site says: "Basic Auth"
UserName: ********
Password: ********
OK | Cancel
I have tried using _lastAlert and a few other ways, but can't seem to close this dialogue by clicking the OK button. _click(_button("OK")) also doesn't seem to work.
Bit stumped, any solutions would be appreciated?
Many thanks
Steve
I have tried searching for an answer, but I am unable to find a solution to it that works.
When I navigate to a set url I am getting prompted with the following message:
Authentication Required
A user name and password are being requested by https://xx.xx.xx.xx. The site says: "Basic Auth"
UserName: ********
Password: ********
OK | Cancel
I have tried using _lastAlert and a few other ways, but can't seem to close this dialogue by clicking the OK button. _click(_button("OK")) also doesn't seem to work.
Bit stumped, any solutions would be appreciated?
Many thanks
Steve
Comments
Which version of Sahi are you using?
Thanks,
Vivek
If this doesn't work for you, there might be some other issue. Please provide sahi version, browser and OS and if you can, the URL.
Thank you for responding quickly.
We are currently using v3.5, and the URL is an internal website unfortunately.
However I will give the following a go, just tried a few ways on Friday on the Javascript alert, and didn't seem to work. But this may resolve the problem.
Many thanks,
Steve