kiffab Posted January 4, 2013 Share Posted January 4, 2013 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? expandcollapse popup; 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 More sharing options...
Andreik Posted January 4, 2013 Share Posted January 4, 2013 Why don't you use IE functions? When the words fail... music speaks. Link to comment Share on other sites More sharing options...
kiffab Posted January 4, 2013 Author Share Posted January 4, 2013 Never tried it.... I will consult the documentation. I don't suppose it allows you to 'hide' things? i.e. run the app and do various IE stuff without actually displaying it on screen? Thanks Link to comment Share on other sites More sharing options...
GMK Posted January 4, 2013 Share Posted January 4, 2013 might be another option--and there are no windows involved, nor do you have to wait for pages and images to load into the browser. Link to comment Share on other sites More sharing options...
GMK Posted January 4, 2013 Share Posted January 4, 2013 I don't suppose it allows you to 'hide' things?Yes, the IE functions allow you to run IE hidden or visible. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now