Sign in to follow this  
Followers 0
syale

Getting to the button

2 posts in this topic

NOOB alert!

I have some basic questions about clicking a button on a web page.

I know how to open IE and get to a web page. On the web page I have to fill in two text boxes (similar to a login except everything is plain text) and then click a button called 'Continue'

So as far as I can see, if I want to automate this process, AutoIT uses the mouse pointer or I can send "tab" to the window to navigate around the web form. This is great whilst the web form remains static but if the webmaster adds another item on the web page my tab commands will go out of sync. If I use coordinates and the webmaster moves the button I lose out again. Is there a way to accurately identify the button through a script so I know I have gotten to it?

I would also like to parameterize the values manually typed in so I can pass them to the script. How do I do that

Stephen

Opt("WinWaitDelay",100)

Opt("WinTitleMatchMode",4)

Opt("WinDetectHiddenText",1)

Opt("MouseCoordMode",0)

Run("C:\Program Files\Internet Explorer\iexplore.exe", "", @SW_MAXIMIZE)

Sleep(2000)

Send('{f6}')

Send("https://www.nvars.com/Production/UserLogin.aspx{ENTER}")

WinWait("Login - Microsoft Internet Explorer provided by KBR","Links")

If Not WinActive("Login - Microsoft Internet Explorer","Links") Then WinActivate("Login - Microsoft Internet Explorer","Links")

WinWaitActive("Login - Microsoft Internet Explorer","Links")

Send("{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}9999{TAB}9999{TAB}{ENTER}")

WinWait("PassportHolder - Microsoft Internet Explorer","Links")

If Not WinActive("PassportHolder - Microsoft Internet Explorer","Links") Then WinActivate("PassportHolder - Microsoft Internet Explorer","Links")

WinWaitActive("PassportHolder - Microsoft Internet Explorer","Links")

Send("{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}")

Send("{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{ENTER}")

WinWait("UserDependent - Microsoft Internet Explorer","Links")

If Not WinActive("UserDependent - Microsoft Internet Explorer","Links") Then WinActivate("UserDependent - Microsoft Internet Explorer","Links")

WinWaitActive("UserDependent - Microsoft Internet Explorer","Links")

Send("{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}")

Send("{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{ENTER}")

WinWait("Book Appointment - Microsoft Internet Explorer","Links")

If Not WinActive("Book Appointment - Microsoft Internet Explorer","Links") Then WinActivate("Book Appointment - Microsoft Internet Explorer","Links")

WinWaitActive("Book Appointment - Microsoft Internet Explorer","Links")

Send("{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{ENTER}")

Share this post


Link to post
Share on other sites



I'd recommend looking up the IE library in the helpfile, try out the examples, and then come back if you still need help.


IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font]

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