abarlev Posted December 18, 2014 Share Posted December 18, 2014 I am using Selenium to test secure websites requiring smart card authentication. The security window that pops up requesting the smart card PIN code is a windows object, therefor cannot be handled by Selenium. I wrote the following AutoIT script which responds to the popup: #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Icon=Grafikartes-Adobe-Cc-Folders-ID.ico #AutoIt3Wrapper_Outfile=SetPinCode_x86.exe #AutoIt3Wrapper_Outfile_x64=SetPinCode_x64.exe #AutoIt3Wrapper_Compression=4 #AutoIt3Wrapper_Compile_Both=y #AutoIt3Wrapper_UseX64=y #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** WinWaitActive("Windows Security", "OK") ControlClick("Windows Security", "OK", "[CLASSNN:Button2]") WinWaitActive("IDProtect Verification") Send("TestCard") WinWaitActive("IDProtect Verification", "Verify") ControlClick("IDProtect Verification", "Verify", "[CLASSNN:Button2]") The script works fine when launched manually. Although, I noticed that I need to set focus on the popup in order for it to work. When I launch from within the application, it does not respond. I tried execution of the exe before and after launching the tested website, neither with much success. Any suggestions would be extremely appreciated. Thanks, Asaf Link to comment Share on other sites More sharing options...
JohnOne Posted December 18, 2014 Share Posted December 18, 2014 Automating Security measures is a bit taboo here on the forum. They're there for a reason, so it's doubtful you'll get any help with that. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
jvanegmond Posted December 23, 2014 Share Posted December 23, 2014 Might just be administrative permissions. Run Selenium with admin rights and include #RequireAdmin on the top of your script (just to make sure). For the activation of the window, instead of: WinWaitActive("Windows Security", "OK") Write: WinWait("Windows Security", "OK") WinActivate("Windows Security", "OK") So that WinWait waits until the window exists, and you then activate it yourself with WinActivate. github.com/jvanegmond Link to comment Share on other sites More sharing options...
Developers Jos Posted December 23, 2014 Developers Share Posted December 23, 2014 Move to support forum SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now