hispeed_mike Posted January 4, 2009 Share Posted January 4, 2009 Hi All,I am trying to automate the setup of a router to be upgraded to DD-WRT frimware and then input the common settings we need.I have got to the point where I can Create the first IE Window and navigate and get the firware loaded, at this point of loading there is a progrees bar while the router flashes. The next thing to occur is a redirect once this is finished which send it to another URL.Sample script to help make sense of this The question is in between the ==== symbols#include <IE.au3> $url = "http://192.168.1.1/Upgrade.asp"$nav = _IECreate ($url, 0, 1, 0, 1)WinWait ("Connect to 192.168.1.1")ControlSend ("Connect to 192.168.1.1", "", "Edit2", "admin")ControlSend ("Connect to 192.168.1.1", "", "Edit3", "admin")ControlClick ("Connect to 192.168.1.1", "", "Button2")Sleep (2000); Navigate to Upgrade.asp and input file to the firmware and submit it.$oForm = _IEFormGetObjByName ($nav, "firmware");$oButton = _IEFormGetObjByName ($nav, "Upgrade_b")if ( $oForm == 0 ) Then MsgBox( 4096, "1 Error in get form", @error )endif$oFirmware = _IEFormElementGetObjByName ($oForm, "file")$oButton = _IEFormElementGetObjByName ($oForm, "Upgrade_b")if ( $oFirmware == 0 ) Then MsgBox( 4096, "2 Error in get element", @error )endif$text = @SCRIPTDIR & "\BinFile\dd-wrt.v24_mini_generic.bin"_IEAction ($oFirmware, "focus")Send ($text)_IEAction ($oButton, "click"); Wait for the Upgrade to complete and then Click continue.========================================THIS IS WHERE I AM FALLING DOWN. WAITING FOR THE FLASH TO COMPLETE AND THEN WAITING FOR THE NEW REDIRECT PAGE TO COMPLETE LOADING BEFORE CLICKING THE CONTINUE BUTTONIT GETS REDIRECTED TO HTTP://192.168.1.1/UPGRADE.CGIHow do I get the $nav variable ot be http://192.168.1.1/upgrade.cgi so I can wait for it to complete loading?========================================$oLoad = _IELoadWait ($nav)$oButton = _IEGetObjByName ($nav, "Upgrade_b")_IEAction ($oButton, "click") 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