Jump to content

Related to login on web page


Recommended Posts

Hi,

Anybody knows how to find the mouse position on web page ?

In my project when login window get opened & we need to enter the User & Password.I am using Mouseclick function as need the position of the x,y co-ordinate?So when running the script the exact mouse pointer location I need to enter the User name.

So this is a problem?

Link to comment
Share on other sites

If you use the "AU3Info" tool in SciTE, you can search for the form and field names of your loginpage.

In your script, include <IE.au3> and then

#include <IE.au3>

        If Not WinActive("Title of Login", "") Then WinActivate("Title of Login", "")
        WinWaitActive("Title of Login", "")
        $oForm = _IEFormGetObjByName($oIE, "loginform")
        $oText = _IEFormElementGetObjByName($oForm, "username")
        _IEFormElementSetValue($oText, "your login name")
        $pText = _IEFormElementGetObjByName($oForm, "password")
        _IEFormElementSetValue($pText, "your login password")
        Sleep(1000)         ; Give it some time (one second here) to load the web page

        $oSubmit = _IEGetObjByName($oIE, "submit")

I'm using this to login from a Java generated page - works without any mouse positioning.

If you don't want to login automatically, you could request the access data username and password separately before running this part ...

Link to comment
Share on other sites

Thanks guwguw

I have written script but it wont work

#include <IE.au3>

$oIE= _IECreate("url address")

If Not WinActive("Title of the window", "") Then WinActivate("Title of the window", "")

WinWaitActive("Title of the window", "")

$oForm = _IEFormGetObjByName($oIE, "loginform")

$oText = _IEFormElementGetObjByName($oForm, "User")

_IEFormElementSetValue($oText, "admin")

$pText = _IEFormElementGetObjByName($oForm, "Password")

_IEFormElementSetValue($pText, "adminl")

Sleep(1000) ; Give it some time (one second here) to load the web page

$oGo = _IEGetObjByName($oIE, "Go")

but my problem is that I am not getting the login form name by using the autoInfo ...

so after opening the home page it would not show anythink ...So I could not get the user name & password that written in script ... & one more thing I want to ask that How would get know that script is running during execution?

Link to comment
Share on other sites

To find the names of the form and form elements, take a look at the source code or us one of the free tools in my sig (IE Developer Toolbar or ModIV2). If it turns out that the form or for elements have no names, check out _IEForm*GetCollection functions.

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

To find the names of the form and form elements, take a look at the source code or us one of the free tools in my sig (IE Developer Toolbar or ModIV2). If it turns out that the form or for elements have no names, check out _IEForm*GetCollection functions.

Dale

Hi DaleHohm,

I want to know how to write script for the more than one button clicked.See I want to click on New button..Ok..then the functionality of new button is that the record should get blank ..Ok..& will able to add new rexord .Next when i click on the Save button then it will display the message "Record saved sucessfully" & when I click on the "Delete" button the record should get deleted & should display the message "record Deleted Sucessfully", Ok & Reset button.

Can You plz tell me the code for that as I am new in AutoIt & also user will click on any button ?

Thanks

Link to comment
Share on other sites

Please look at the _IEAction cunction with a "click" parameter.

Please work through some of the _IE* examples in the helpfile to help you understand the way it all works. In particular, look at _IECreate, _IEAttach, _IEAction and the _IEForm* functions.

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...