Jump to content

_IEForm.... etc


RussMuss
 Share

Recommended Posts

I want to fill in edit boxes ie Employee id and password. Our website has been changed and redesigned, so unfortunately the

code below no longer works. This was written by "psSaltyds" I never really understood how he arrived the code, so I don't know

how to rewrite to suit our new website login page. The AutoIt Window Info tool seems of no help. Does anyone have any ideas?

I have changed the url address to our new one.

Thanks Russ

#include <ie.au3>

$URL = "https://time.urscorp.com/DeltekTC/";new url address

$EmployeeID = "ABC123"

$Password = "Password123"

$oIE = _IECreate($URL)

$oForm1 = _IEFormGetCollection($oIE, 0)

$oEmplID = _IEFormElementGetObjByName($oForm1, "emplid")

_IEFormElementSetValue($oEmplID, $EmployeeID)

$oPass = _IEFormElementGetObjByName($oForm1, "pass")

_IEFormElementSetValue($oPass, $Password)

_IEFormImageClick($oForm1, "images/ok_button.gif")

Link to comment
Share on other sites

I want to fill in edit boxes ie Employee id and password. Our website has been changed and redesigned, so unfortunately the

code below no longer works. This was written by "psSaltyds"

Don't know who this "psSaltyds" is, but I'll bet he's a fine looking fellow... :P

I never really understood how he arrived the code, so I don't know how to rewrite to suit our new website login page.

Give a man a fish... teach a man to fish... yada, yada, yada... :)

The AutoIt Window Info tool seems of no help. Does anyone have any ideas?

I have changed the url address to our new one.

Thanks Russ

#include <ie.au3>

$URL = "https://time.urscorp.com/DeltekTC/";new url address

$EmployeeID = "ABC123"

$Password = "Password123"

$oIE = _IECreate($URL)

$oForm1 = _IEFormGetCollection($oIE, 0)

$oEmplID = _IEFormElementGetObjByName($oForm1, "emplid")

_IEFormElementSetValue($oEmplID, $EmployeeID)

$oPass = _IEFormElementGetObjByName($oForm1, "pass")

_IEFormElementSetValue($oPass, $Password)

_IEFormImageClick($oForm1, "images/ok_button.gif")

You're not going to get it written for you. But you can learn it and then be able to change any time it's required.

If you must have someone write it for you, check out the Rent-A-Coder link in my sig.

If you want to figure it out, you'll get plenty of help here. Fist questions would be: how many lines down in that code do you already understand? Where does it become confusing to you? At which point does it seem to be failing?

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Hi

I just wanted to understand it, so I could ammend it to suit.

I would like to understand basically what is shown below.

Firstly.....

How did you arrive at "emplid" for $oEmplID = _IEFormElementGetObjByName?

and "pass" for $oPass = _IEFormElementGetObjByName?

I have looked at the help file but it doesn't make it any clearer

thanks

$oIE = _IECreate($URL)

$oForm1 = _IEFormGetCollection($oIE, 0)

$oEmplID = _IEFormElementGetObjByName($oForm1, "emplid")

_IEFormElementSetValue($oEmplID, $EmployeeID)

$oPass = _IEFormElementGetObjByName($oForm1, "pass")

_IEFormElementSetValue($oPass, $Password)

_IEFormImageClick($oForm1, "images/ok_button.gif")

Link to comment
Share on other sites

How did you arrive at "emplid" for $oEmplID = _IEFormElementGetObjByName?

and "pass" for $oPass = _IEFormElementGetObjByName?

I have looked at the help file but it doesn't make it any clearer

thanks

If you use Firefox, you can generally right click anywhere on the page and then click "View Source".

This gives you the source code of the page, then you can scroll around and eventually you will find something like "password" or "login".

You can also right click on the page and then click "View Page Info", click the tab that says forms and you will find a list of names used on the form.

Hope that helps, good luck.

Link to comment
Share on other sites

thanks

I have switched to firefox and yes it looks useful for source info. However I am not to sure what the name of the 'login' or 'password' identities are? It's either 'pass' pass2 or 'authuser' I have tried different combo's but it just will not fill in the edit boxes.

If you use Firefox, you can generally right click anywhere on the page and then click "View Source".

This gives you the source code of the page, then you can scroll around and eventually you will find something like "password" or "login".

You can also right click on the page and then click "View Page Info", click the tab that says forms and you will find a list of names used on the form.

Hope that helps, good luck.

Link to comment
Share on other sites

  • Moderators

If you had tried what I had suggested you could have done this yourself.

#include <IE.au3>

$sURL = "https://time.urscorp.com/DeltekTC/"
$sEmployeeID = "ABC123"
$sPassword = "Password123"
$sDomain = "PDEGGDIV"

$oIE = _IECreate($sURL)
$oForm = _IEFormGetCollection($oIE, 0)
$oEmplID = _IEFormElementGetObjByName($oForm, "uid")
$oPass = _IEGetObjById($oForm, "passField")
$oDomain = _IEFormElementGetObjByName($oForm, "sltdom")

_IEFormElementSetValue($oEmplID, $sEmployeeID)
_IEFormElementSetValue($oPass, $sPassword)
_IEFormElementOptionselect($oDomain, $sDomain, 1, "byText")

_IEFormSubmit($oForm)
Link to comment
Share on other sites

thanks Big Daddy - yes that works great

I did try and download DebugBar, however our I.T. department will not allow us to download new software. :-(

It seems to be interesting, though I am not sure what it actually does. I will try and download it at home.

cheers Russ

If you had tried what I had suggested you could have done this yourself.

#include <IE.au3>

$sURL = "https://time.urscorp.com/DeltekTC/"
$sEmployeeID = "ABC123"
$sPassword = "Password123"
$sDomain = "PDEGGDIV"

$oIE = _IECreate($sURL)
$oForm = _IEFormGetCollection($oIE, 0)
$oEmplID = _IEFormElementGetObjByName($oForm, "uid")
$oPass = _IEGetObjById($oForm, "passField")
$oDomain = _IEFormElementGetObjByName($oForm, "sltdom")

_IEFormElementSetValue($oEmplID, $sEmployeeID)
_IEFormElementSetValue($oPass, $sPassword)
_IEFormElementOptionselect($oDomain, $sDomain, 1, "byText")

_IEFormSubmit($oForm)
Link to comment
Share on other sites

thanks Big Daddy - yes that works great

I did try and download DebugBar, however our I.T. department will not allow us to download new software. :-(

It seems to be interesting, though I am not sure what it actually does. I will try and download it at home.

cheers Russ

I also downloaded DebugBar based on Dale's recommendation. If you have ever used AutoIt's Window Info tool, it will look familiar, except instead of showing you Window and Control information, it displays the HTML DOM objects associated with a web page item.

Back when I was working on this with you before, however, I did it the hard way: Firefox's View/Page Source, then scanning the code visually.

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

  • Moderators

thanks Big Daddy - yes that works great

I did try and download DebugBar, however our I.T. department will not allow us to download new software. :-(

It seems to be interesting, though I am not sure what it actually does. I will try and download it at home.

cheers Russ

Your welcome.

I had a chance try DebugBar and I must say it is very handy.

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...