Javascript form submission button stored as a image

Nov 15, 2012 at 3:04 PM
Edited Nov 15, 2012 at 3:29 PM

Hi Everyone,
I am currently trying to automate a login via IE.  Here is a link to the webpage: https://fiaegus.markit.com/egus/auth/login.jsp
Login button is stored as a image and doesn't have element id or tag name I can use to identify the button. So I tried to use the Select-Title and then Send Keys approach but nothing happens.  Has anyone encountered a similar issue? If so, any suggestions would be appreciated. I'm just spinning my wheels at this point :)

$username = 'username'                                                                                                      
$password = 'password'

$IEProcess = Select-Window -Title "FIA Electronic Give-Up System Login*" 

# Create the IE com object                                                                                            
 $ie = new-object -com InternetExplorer.Application $ie.navigate("https://fiaegus.markit.com/")                               
do {sleep 1} until (-not ($ie.Busy))                                                                        
$ie.visible = $true
$usernameField = $doc.getElementById('username')                                
$usernameField.value = $username                                                                                                 
$passwordField = $doc.getElementById('password')                                                                       
$passwordField.value = $password 
$IEProcess | Send-Keys "{Enter}"

Coordinator
Nov 15, 2012 at 7:54 PM
Edited Nov 15, 2012 at 7:54 PM

My suggestion with automating browsers is always to use Selenium's WebDriver ( http://huddledmasses.org/did-you-know-powershell-can-use-selenium/ ) or WaTiN ( http://huddledmasses.org/using-powershell-and-watin-powerwatin/ ) but in this case, you should be able to:

$doc.getElementById('loginForm').submit()

Nov 16, 2012 at 9:57 PM

Selecting the elementID worked, I thought I tried this before..I must have had a flaw in my syntax. I will look into you other automation options you suggested as well.  Thanks for your help.