I'm coding a selenium driver program have auto login but I cant find anything on login form.
How to input text in password and account on this form?
I'm coding a selenium driver program have auto login but I cant find anything on login form.
How to input text in password and account on this form?
It's not HTML form. It's a dialog supplied by OS, not browser. So you can't use selenium to automate it.
You can use Java Class Robot
to operate it, but Robot
class can only operate dialog on local where your script reside. If you use RemoteWebDriver and open browser on remote machine, the Robot
class will can't work.
So far as I know, there is no good solution to support local and remote cases same time.
You are talking about basic-auth and there are some solutions.
Selenium - Basic Authentication via url
Either via credentials in url(which doesnt work for chrome anymore) or remote-debugging in chrome.
Try this
import org.openqa.selenium.NoAlertPresentException;
import org.openqa.selenium.Alert;
driver.switchTo().alert().sendKeys("username" + Keys.TAB + "password");
driver.switchTo().alert().accept();
If ur using selenium with java try this
import org.openqa.selenium.NoAlertPresentException;
import org.openqa.selenium.Alert;
driver.switchTo().alert().sendKeys("username" + Keys.TAB + "password");
driver.switchTo().alert().accept();