Jump to content

Recommended Posts

Posted (edited)

I need help with automating a web page to schedule a racquetball court at LAFITNESS.

I have done several autoit scripts, but need help with web page content and choices.

My platform is windows 10 on a Lenovo notebook...

(screens might not be in order)

screen 1 is shows the overall choices I need to make

screen 2 shows the first choice which is the date.   Normally the date I want is the very bottom date

screen 3 is the duration choice   will always be "120 minutes"

screen 4 is the time    will always be 5:30

screen 5 is the court choice   preferential order is  court 2, then court 4, then court 1

I sure would like to learn how to make these choices.  I have had other occasions to need this knowledge.

Thank you so very much...   Jim

laf screen 2.jpg

laf screen 1.jpg

laf screen 3.jpg

laf screen 4.jpg

laf screen 5.jpg

Edited by speedi
picture order
Posted

Greetings!

I have found that getting the Window Handle , setting MouseCoordMode = 2 , and then using the Autoit "Window Info" tool is the best way to handle situations like this.

Combinations of 

MouseClick ("primary" , x, y, 1, 10)

MouseWheel ("down" , 1)

Sleep (100)

Send ("{TAB}")

and similar sets of commands will be what you will use in all likeliness.

You just need to be sure that the window is always the same size and the options don't move around on you.

Func getHandle ()
   $workWin = WinGetHandle ("")
   ConsoleWrite ($workWin&@CR)
EndFunc

That's to get the handle ( I usually set that function to a hotkey )

Func setWorkWin ()

   Local $winPos01 = WinGetPos ($workWin);Check out where the window is currently.
   WinMove ($workWin, "", $winPos01[0], $winPos01[1], 1030, 600, 20);Change the window size but keep it in the same place
   Global $winPos02 = WinGetPos ($workWin);Check the window again

   If $winPos01[2] == $winPos02[2] Then;&& $winPos01[3] == $winPos02[3] Then ; Resize check
      ConsoleWrite ("Window didn't resize"&@CR)
   Else
      ConsoleWrite ("Window Resized"&@CR)
   EndIf

   EndFunc

That generally works well to resize a window after  you get it's handle

Further than that it all depends on the UI you are working with and the options you need to select. Take your time and actually make note of every time you click and where you are clicking ( literally, click and write it down! ). From there you can build a process of MouseClicks and such to get your task done.

Hope this helps!

-Reiz

Posted
2 hours ago, markyrocks said:

@Reizvoller stuff like you described is great. But as junkew points out there are definitely more sophisticated methods to accomplish what the op trying to do.

Howdy, 

I am just learning about said sophisticated approaches myself so I didn't feel sure enough to offer them up as solutions. You are absolutely correct though :)

Posted

Check out the examples for _IECreate _IEAttach and _IETagNameGetCollection. Those work only with IE , but that should not be a problem.

Posted

If a court has already been reserved, or a time slot is no longer available, does it still show up in the dropdown list (maybe grayed out) or is is left off the list altogether?

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
  • Recently Browsing   0 members

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