Sign in to follow this  
Followers 0
PeterdeB

AutoLogin Project 'needs' 17 TABS?

11 posts in this topic

Hi Guyz!

Here's my project which does what its supposed to do > Fire up IE > enter UserName and PassWord submit it et voila: I'm logged in! All code comes from the forum here, the thing I'm trying to alter is the 17 TABS needed to get to the first of two edit boxes in order to enter the username. Furthermore it would be nice if the window was hidden until I'm logged in. If there's a more efficient way of getting my hands on that editbox then my guess would be that one of you guyz perhaps could tell me how. :)

AutoItSetOption("SendKeyDelay", 200)

$url = "http://myforum.com/index.php?act=login"

$path=@ProgramFilesDir & "\Internet Explorer\iexplore.exe"

Run($path & " -new " & $url)

Sleep(400)

winwaitActive("Inloggen - Microsoft Internet Explorer")

Send("{TAB 17}") ; < this is the problem

Send("UserName")

Send("{TAB}")

Send("PassWord")

Send("{ENTER}")

My regards and max respect to all of ya!!

Peter

Share this post


Link to post
Share on other sites



Have you considered of using AU3_Spy.exe and the ControlSend/ControlClick functions?

Have a look in the helpfile and if you don't have a clue let us know to help :)

Share this post


Link to post
Share on other sites

We tried Control* functions and we failed.

Because IE uses one big control for the display (pictures, text, combobox, etc.)

I haven't found a way to control a website invisibly.

That's what you want, right?

The reason I haven't posted earlier is because I don't have a workaround or solution.

Good luck.

Share this post


Link to post
Share on other sites

Since AU3 Control functions are incompatible with the IE's controls (and you don't want to use a different browser), the "17 tabs" trick look good to me..

Share this post


Link to post
Share on other sites

Hi Guyz!! First of all thanks for responding both of you!!

Erebus > Yes I used the Spy but funny thing was that the first of what I believed to be two editboxes, came up with something totally different than the second one.

(classname = IEFrame)

msctls_statusbar321(hidden) > the first editbox

internet_explorer_server1 > the second editbox

I wrote an app to autologin to that forum using Delphi and that app was okay except for the fact I couldnt find a proper way to have it wait until the page is loaded prior to inserting the username and pass and hitting the login button. Using a TWebbrowser provided the DocumentComplete which helped me out but my goal was to do that without the TWebbrowser and when I ran into this autoit program and noticed how small the apps were it created I got interested in autoitting the autologin because of the WinWaitActive which kinda solves my problem regarding the page being loaded prior to inserting the text. Just for the records btw > I'm not a programmer and only play with Delphi by means of having something to do in the time I'm left with for the couple of months probably. My Delphi autologin program works only when the temporary internet files are present, otherwise it fails to login and since I keep my computer rather tidy I'm facing this problem which brought me to Experts Exchange but so far no one could help me solve this problem in Delphi so I expanded my view with Autoit I even considered to combine the 90 kB IE page opening Autoit app with my Delphi Program but when I discovered that the first editbox could be reached in a similar way I got my hands on other controls in other windows using TABS I got curious and wondered if there was a faster way of doing so. So this is the background information.

I studied several assisting answers on this forum here regarding ControlSend and ControlSetText but so far I haven't been successful in comprehending how they really work.

Then SlimShady > yes I guess you're right although the invisible thingie is not a bare necessity I mainly want to get my hands on that edit box without having to send 17 TABS but if this is fairly impossible then I'll seize my attempt to do so however I lack the knowledge and I'm far from aware which limitations auto it faces.

Tnx for your replies! If you need more information or if you think I'd better stick to Delphi then let me know I value your opinion and I'm not that stubborn so if I'm trying to implement the impossible then be my guest to have me wake up and smell the coffee ok? :)

Regs and respect!

Peter

Share this post


Link to post
Share on other sites

Try adding a sleep between tabs. AutoIt presses those keys VERY fast and a lot of times the window won't pick up the keystrokes, try putting a sleep(10) after each one or something.

Share this post


Link to post
Share on other sites

Since AU3 Control functions are incompatible with the IE's controls (and you don't want to use a different browser), the "17 tabs" trick look good to me..

I overlooked this reply and only noticed it after I sent mine. It kinda answers my question.

Try adding a sleep between tabs. AutoIt presses those keys VERY fast and a lot of times the window won't pick up the keystrokes, try putting a sleep(10) after each one or something.

Ok I will try thanks for repsonding!

peter

Share this post


Link to post
Share on other sites

That's a nice idea Larry! Sounds kind of complicated though. But I suppose that you could make it work for a different resolution under certain conditions.

Share this post


Link to post
Share on other sites

Larry and ManWithHardToSpellName :) thanks for the replies! I decided to stick to the 17 TABS partially because of the fact your words (Larry) are almost Greek to me and partially because it seems quite some work to have it working on different pc's with different resolutions.

My regs and respect!

Peter :)

Share this post


Link to post
Share on other sites

I decided to stick to the 17 TABS partially because of the fact your words (Larry) are almost Greek to me and partially because it seems quite some work to have it working on different pc's with different resolutions.

<jk>Hey, I'm Greek too! :)</jk>

I tested the Control functions with AU3_Spy and all of you are correct... However it seems like IE's stupidity to identify the html's controls, not AU3's (maybe IE doesn't need to identify them like Windows normally does? dunno...).

Apart from that I considered of a way to automatically login using a URL with variables (something like:

http://my.forum.jp/index.php?action=Login&user=PeterdeB&password=helloFOLKS!

Of course this depends on the forum script each website uses; I have tested a bit with Invision but no luck... Try by downloading the forum script from the internet and investigating the (php) source code a bit, you might find something useful there..

In anyway, my advice would be to stick with AU3. You 'll find so many functions in Window's automation than you ever imagine.. Ok, some things may must work in a little tricky way (depending on what you want to achieve), but who cares if it finally works? :}

Greetings and welcome to our company,

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