Rafał Podraza
Rafał Podraza

Reputation: 55

Selenium Java - How to log in with the @ sign Alert

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@[email protected]

 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

Upvotes: 1

Views: 100

Answers (1)

CEH
CEH

Reputation: 5909

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%[email protected]"

Upvotes: 1

Related Questions