如何将文本发送到基本身份验证中的用户名和密码字段?



请帮帮我!我尝试进入我的应用程序 (https://testing.shipnext.com/(,但模式窗口不允许我。我必须输入登录/密码,但我不能这样做。我尝试使用此代码:

警报警报;

@BeforeClass
public static void setup(){
System.setProperty("webdriver.chrome.driver", "/home/qa-1/IdeaProjects/chromedriver");
driver = new ChromeDriver();
loginPage = new LoginPage(driver);
driver.manage().window().maximize();
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
driver.get("https://testing.shipnext.com/");
}
@Test
public void alertText(){
alert = driver.switchTo().alert();
alert.sendKeys("myLogin");

请使用以下带有凭据(有效用户名和密码(的语句来启动URL。

driver.get("https://**username**:**password**@testing.shipnext.com/");

最新更新