java - Can we use sikuli for automation of http pop up? -
i using selenium automation of web application . getting http login (asking username , password) pop ups on web pages during automation. , using sikuli automate pop ups. using following code it:
private void loginwithsikuliinfirefox(){ try{ screen screen=new screen(); pattern image1=new pattern("pictures/uname.png"); pattern image2=new pattern("pictures/passwrd.png"); pattern image3=new pattern("pictures/ok1.png"); screen.wait(image1,10); screen.type(image1,username); screen.type(image2,password); screen.click(image3); } catch(exception e){ system.out.println("there no alert"); } } private void loginwithsikuliinchrome(){ try{ screen screen=new screen(); pattern image1=new pattern("pictures/username.png"); pattern image2=new pattern("pictures/password.png"); pattern image3=new pattern("pictures/login.png"); screen.wait(image1,10); screen.type(image1,username); screen.type(image2,password); screen.click(image3); } catch(exception e){ system.out.println("there no alert"); } }
i make 2 different function can work in firefox , chrome. these working perfectly.
so, using sikuli better option or should use else? tried switch alert not working in chrome. please suggest other switch alert if sikuli not better option .
thanks in advance
if accessing direct url has htaccess/http popup can go http://username:password@www.yoursiteurl
pattern. bypass login popup. way execution faster sikuli implementation. have add sikuli execution files, jars etc in project folder.
also can use autiit handle htaccess popup work windows environment only. sikuli work win/linux/mac all. have capture different images different os/browser combination. i.e. code have written win chrome may not work mac chrome.
Comments
Post a Comment