Jump to content
Sign in to follow this  
shx

Can't seem to click a button on a web Page - using IE function

Recommended Posts

shx

I am trying to automate logging in to a website.

I am able to have the user id and password entered using an autioit script but can't get the login button clicked.

Here is my code.

#include <IE.au3>
Local $oIE = _IECreate("http://www.helpkidzlearn.com")
Local $oForm = _IEFormGetObjByName($oIE, "form1")
Local $oUserName = _IEFormElementGetObjByName($oForm, "Login1_UserName")
Local $oPassword = _IEFormElementGetObjByName($oForm, "Login1_Password")
_IEFormElementSetValue($oUserName, "xxxxxxxxx")
_IEFormElementSetValue($oPassword, "yyyyyyyyyy")

to click the login button I have tried

_IELinkClickByText($oIE, "Login1")
_IELinkClickByText($oIE, "Login1_LoginButton")
_IELinkClickByText($oIE, "ctl00$Login1$LoginButton")
_IEFormImageClick($oIE, "ctl00$Login1$LoginButton", "name")
_IELinkClickByIndex($oIE, 19)

and can't seem to get it to work.

Here is the appropriate code (it think, not really know html)

<div class="AspNet-Login" id="Login1">
                             <fieldset>
                                 <label for="Login1_UserName" id="Login1_emailLabel">Username:</label>
                                 <input name="ctl00$Login1$UserName" type="text" id="Login1_UserName" /><span id="Login1_EmailValidator" class="valid" style="visibility:hidden;">*</span>
                                    
                                 <label for="Login1_Password" id="Login1_passwordLabel">Password:</label>
                                 <input name="ctl00$Login1$Password" type="password" id="Login1_Password" /><span id="Login1_PasswordValidator" class="valid" style="visibility:hidden;">*</span>
                                 <input type="submit" name="ctl00$Login1$LoginButton" value="Login" onclick="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(&quot;ctl00$Login1$LoginButton&quot;, &quot;&quot;, true, &quot;HeaderLogin&quot;, &quot;&quot;, false, false))" id="Login1_LoginButton" class="register filter" />
                                 <input type="submit" name="ctl00$Login1$RegisterButton" value="Register" id="Login1_RegisterButton" class="login filter" />
                             </fieldset>
                             <div id="Login1_fail" class="fail">
                                 </div>
                        
</div>

Any help would be greatly appreciated.

Steven

Share this post


Link to post
Share on other sites
Valik

Locked per the rules.

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.