![](/img/trans.png)
[英]How to By Pass NTLM authentication pop up while performing automation testing using Selenium web driver for Chrome browser?
[英]How to take runtime input in selenium while automation testing?
我試圖在運行時從用戶那里獲取數據,同時自動化 Web 應用程序。 我搜索了很多,但我找不到任何東西。 我已經嘗試過這種方法。 (下面提到的代碼)
Scanner scanner_user = new Scanner(System.in);
System.out.println("Enter your Email or Phone : ");
String user = scanner_user.nextLine();
System.out.println("our otp is " + user.toString());
但它不起作用。 它要求在控制台中輸入數據,但它說只讀視圖。 請幫助我如何在運行時獲取數據。
在這種情況下,您可以使用以下內容,用戶通過控制台手動傳遞password
。
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String password;
System.out.println("Please Enter the user password :: ");
password= br.readLine();
driver.findElement(By.id("pwd")).sendKeys("password");
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.