How can I close or How can I enter the UserId and password and click on Login?
Please help me in handling this alert
How can I close or How can I enter the UserId and password and click on Login?
Please help me in handling this alert
You can use like this in JAVA:
driver.get("http://username:password@www.domain.com");
This may help you :-
String Password = URLEncoder.encode("pass");
String UserName= URLEncoder.encode("UserName");
String url = String.format("http://%s:%s@xyz", UserName, Password);
In this %s is variable which pass to url in form of parameter .
You can refer this url also https://serverfault.com/questions/371907/can-you-pass-user-pass-for-http-basic-authentication-in-url-parameters
Did you try desiredCapabilities?
This should close alert while in automated window
DesiredCapabilities dC= DesiredCapabilities.chrome()
dC.setCapability(CapabilityType.UNEXPECTED_ALERT_BEHAVIOUR,UnexpectedAlertBehaviour.ACCEPT)