Sign in to follow this  
Followers 0
Mecrazycoder

Can't able to auto login into web page

15 posts in this topic

#1 ·  Posted (edited)

Hi All,

Right now i am trying to login into particular web page using AutoIT. But it seems my code for login fails.Please someone here help me to figure out the problem. I have attach the source for that web site. My code is something like

#include <IE.au3>
$oIE = _IECreate("http://www.xyz.com/Login.html")
$oForm = _IEFormGetObjByName ($oIE, "Login")
$oQuery = _IEFormElementGetObjByName ($oForm, "username")
_IEFormElementSetValue ($oQuery, "Admin")
_IEFormSubmit ($oForm)

Thanks in advance

Login.html

Edited by Mecrazycoder

[size="4"][font="Arial Narrow"][font="Garamond"]Attitude is a little thing that makes a big difference[/font][/font][/size][indent][/indent]

Share this post


Link to post
Share on other sites



_IEFormSubmit ($oForm, 0)
_IELoadWait($oIE)

Thanks for the reply. But actually it is not the problem. I cant even able to read the HTML using AutoIT. Since that web page is making use of Yahoo UI, will it be the problem?

[size="4"][font="Arial Narrow"][font="Garamond"]Attitude is a little thing that makes a big difference[/font][/font][/size][indent][/indent]

Share this post


Link to post
Share on other sites

And what about the password field, don't you need to supply this info too? What the problem is? Page not responding? Script not responding? Can't login?

Share this post


Link to post
Share on other sites

And what about the password field, don't you need to supply this info too? What the problem is? Page not responding? Script not responding? Can't login?

Actuallyn we need to supply password. That is my sample script.Problem was can't able to enter into any of the fields. Moreover i cant able to read the html content using autoit function

[size="4"][font="Arial Narrow"][font="Garamond"]Attitude is a little thing that makes a big difference[/font][/font][/size][indent][/indent]

Share this post


Link to post
Share on other sites

What is the site you try to login to?

Share this post


Link to post
Share on other sites

What is the site you try to login to?

Actually its an web application that we developed. I am trying to do automated testing using AutoIT.

[size="4"][font="Arial Narrow"][font="Garamond"]Attitude is a little thing that makes a big difference[/font][/font][/size][indent][/indent]

Share this post


Link to post
Share on other sites

This works for me:

include <IE.au3>
$oIE = _IECreate("c:\Login.html")
$oForm = _IEFormGetObjByName ($oIE, "Login")
$oQuery = _IEFormElementGetObjByName ($oForm, "username")
_IEFormElementSetValue ($oQuery, "Admin")
$oQuery = _IEFormElementGetObjByName ($oForm, "password")
_IEFormElementSetValue ($oQuery, "Admin2")
;_IEFormSubmit ($oForm)

Share this post


Link to post
Share on other sites

This works for me:

include <IE.au3>
$oIE = _IECreate("c:\Login.html")
$oForm = _IEFormGetObjByName ($oIE, "Login")
$oQuery = _IEFormElementGetObjByName ($oForm, "username")
_IEFormElementSetValue ($oQuery, "Admin")
$oQuery = _IEFormElementGetObjByName ($oForm, "password")
_IEFormElementSetValue ($oQuery, "Admin2")
;_IEFormSubmit ($oForm)

Thanks. But its not working for me.

[size="4"][font="Arial Narrow"][font="Garamond"]Attitude is a little thing that makes a big difference[/font][/font][/size][indent][/indent]

Share this post


Link to post
Share on other sites

What is your OS , IE , Autioit versions?

Check out the IE settings and security options.

Share this post


Link to post
Share on other sites

What is your OS , IE , Autioit versions?

Check out the IE settings and security options.

I don't think OS,IE,AutoIT versions are the problems because i can automate any web sites other than this one. Only thing that striking me is server. I am using Oracle web logic server.

[size="4"][font="Arial Narrow"][font="Garamond"]Attitude is a little thing that makes a big difference[/font][/font][/size][indent][/indent]

Share this post


Link to post
Share on other sites

You have attached one html file. Is it working with it when you save it on C drive as i have?

Share this post


Link to post
Share on other sites

I have a similar problem - it works using the _IEFormGetObjByName() and _IEFormElementSetValue() on most webpages , but certain javascript pages with frames and/or tables it doesn't work at all. There must be other functions within IE.au3 that enable you to do this

Share this post


Link to post
Share on other sites

Install "debugbar" or other similar software to help you in IE automation.

Share this post


Link to post
Share on other sites

Install "debugbar" or other similar software to help you in IE automation.

Let me check.....Tanx

[size="4"][font="Arial Narrow"][font="Garamond"]Attitude is a little thing that makes a big difference[/font][/font][/size][indent][/indent]

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0