Handling basic authentication through autoit-selenium-For Chrome
Step 1: save it as EXE
;ShellExecute("@site") No need to execute the shell-For testing purpose only
;WinWait("10 secs","10",5)
AutoItSetOption("WinTitleMatchMode","2")
WinWait("Untitled - Google Chrome")
$title = WinGetTitle("Untitled - Google Chrome") ; retrives whole window title
$UN=WinGetText($title,"User Name:")
ControlSend($title,"",$UN,"demo");Sets Username
$PWD=WinGetText($title,"Password:")
Send("{TAB 1}")
ControlSend($title,"",$PWD,"tools");Sets PWD
Send("{ENTER}")
Step 2: Open your webdriver code
@Test
public void testUntitled()
{
Runtime run = Runtime.getRuntime();
Process pp=run.exec("C:\\Program Files\\AutoIt3\\Examples\\Login.exe");
driver.naviageto("@site")
...................
...................
}
----:) That's it
Subscribe to:
Posts (Atom)