Jump to content

Automation on a website


 Share

Recommended Posts

Hi Guys

I'm trying to automate activity on a website to run a report and add it to a database. I can do this but there are several flaws.... the main one being how slow this particular site is. It has multiple servers and the speed is just pot luck depending on how many users we have in. Here's what I'm doing so far. What I really need is something more robust like 'wait until xxx appears then............'.

Any ideas?

; Winactivate function
Func _WinWaitActivate($title,$text,$timeout=0)
WinWait($title,$text,$timeout)
If Not WinActive($title,$text) Then WinActivate($title,$text)
WinWaitActive($title,$text,$timeout)
EndFunc

;Specify URL
$url = "https://mysite.com"

; Open IE, browse to URL
ShellExecute ( "C:\Program Files\Internet Explorer\iexplore.exe", $url )

; Login
_WinWaitActivate("My Site - Login - Windows Internet Explorer provided by my organisation","Address Combo Contro")
Send("{SHIFTDOWN}username{TAB}password{ENTER}")

; Allow for slowness...
Sleep(10000)

; Click
_WinWaitActivate("My Site - Announcements - Windows Internet Explorer provided by my organisation","")
MouseClick("left",107,521,1)

; More Slowness...
Sleep(10000)

; click report and select option
_WinWaitActivate("My Site- List - Windows Internet Explorer provided by my organisation","")
MouseClick("left",400,211,1)
MouseClick("left",400,270,1)

; Allow for more slowness
Sleep(15000)

; Click the csv button
MouseClick("left",334,225,1)

_WinWaitActivate("Internet Explorer","Do you want to allow")
Send("{TAB}{SPACE}")
_WinWaitActivate("Message from webpage","Content has been cop")
Send("{SPACE}")
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...