1

I have a problem accessing the site where authentication in the form of an alert is required. Photo: Click here

My data: Login: login Password: password@123

I set this address in the propertires file:

url=http://login:password@123@website.com

 driver.manage().deleteAllCookies();
 driver.get(data.getData().getProperty("url"));
 Thread.sleep(5000);
 log.info("Successed Login ");

I can't access the page. The problem is probably because the @ sign is in the password. Unfortunately I can't change it. Is there any solution for this?

Thank you in advance for your help

1 Answers1

1

It looks like you need to use some encoding to escape the character. According to this documentation on RFC3986, you can encode @ using the %40 character:

url= "http://login:password%40123@website.com"
Christine
  • 5,567
  • 2
  • 12
  • 35
  • Christine, thanks for the reply. The above solution does not want to work: /. It is treated as a normal string. – Rafał Podraza Nov 19 '19 at 19:25
  • 1
    Interesting, as both of these solutions seems to describe your exact issue: https://stackoverflow.com/questions/20574841/http-basic-authentication-url-with-in-password and https://stackoverflow.com/questions/6718471/escaping-username-characters-in-basic-auth-urls – Christine Nov 19 '19 at 19:27