VanessaWen Posted July 6, 2019 Share Posted July 6, 2019 (edited) Hi experts! I am still a newbie in AUTOIT. I intend to automate a 15 mins burn in test application to test on industrial PC. The application is limited to 15 mins due to free evaluation mode. Problem: Mouseclick is unable to function in this application. However, when I test it on Notepad, it works. I believe it is due to "run as administrator " limitation. I tried implementing the RunAs command, however the error says "unknown function name". Could somebody kindly help to point out what has gone wrong? Below is the script I used. expandcollapse popup#include <AutoItConstants.au3> Dim $ChipRunFileName AutoItSetOption("MouseCoordMode",1) Opt("WinTitleMatchMode", 3) ;$maincycles = 3 $trailingchipnumber = 0 ; Change the username and password to the appropriate values for your system. Local $sUserName = "Chewy" Local $sPassword = "12345678" ; Run Notepad with the window maximized. Notepad is run under the user previously specified. Local $iPID = RunAs($sUserName, Chewy, $sPassword, $RUN_LOGON_PROFILE, "bit.exe") RunTestCycle(100) Func RunTestCycle($noOfTimes) For $i = 1 to $noOfTimes Step 1 Sleep(4000) MouseClick("left",771,10) Sleep(1000) ;click Go MouseClick("left",40,135) Sleep(1000) ;wait 15.5 mins Sleep(930000) ; Click save MouseClick("left",1398,93) ; select text box MouseClick("left", 854, 353) ControlSetText ( "Save results report", "", 1000, "") ; select text box MouseClick("left", 854, 353) ;put manual barcode $trailingchipnumber = $trailingchipnumber + 1 Send("D:\Programs\BurnInTest\BurnInTestLog" & $trailingchipnumber) MouseClick("left", 839, 406) ; select log Sleep(1000) ; select Save MouseClick("left", 688, 502) Sleep(1000) ; select Reset MouseClick("left", 52, 129) Sleep(1000) ; select OK MouseClick("left", 765, 494) Sleep(1000) Next ; Quit Application MouseClick("left",1514,16) Sleep(1000) ProcessClose($iPID) EndFunc Edited July 6, 2019 by Melba23 Added code tags Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted July 6, 2019 Moderators Share Posted July 6, 2019 (edited) VanessaWen, Welcome to the AutoIt forums. I have moved your thread to the appropriate forum. When you post code in future please use Code tags - see here how to do it. Then you get a scrolling box and syntax colouring as you can see above now I have added the tags. Thanks in advance for your cooperation. M23 Edited July 6, 2019 by Melba23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Developers Jos Posted July 6, 2019 Developers Share Posted July 6, 2019 7 minutes ago, VanessaWen said: Problem: Mouseclick is unable to function in this application. However, when I test it on Notepad, it works. I believe it is due to "run as administrator " limitation. I tried implementing the RunAs command, however the error says "unknown function name". Make sure you run the script with the same credentials at the same level as the shelled program or else it will be hard to automate that shelled script. Normally added @requireAdmin at the top will do the job as your script is then (re)shelled as Administrator after you clicked the UAC prompt. Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
VanessaWen Posted July 6, 2019 Author Share Posted July 6, 2019 Hi Jos, Hmm, it is not I am looking for. What I meant is, the BurnInTest Application is run with administrator right. The Autoit script mouse click is not working with BurnInTest app. requireAdmin is meant for allowing only administrator to run the script right? I dont need administrator right to run the script, but letting the script to have the administrator right to run the BurnInTest. Link to comment Share on other sites More sharing options...
Developers Jos Posted July 6, 2019 Developers Share Posted July 6, 2019 16 minutes ago, VanessaWen said: requireAdmin is meant for allowing only administrator to run the script right? No .... it will force the script to be run with Administration rights... Maybe reread my previous post which does explain why I proposed it? VanessaWen 1 SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
VanessaWen Posted July 6, 2019 Author Share Posted July 6, 2019 Hi Jos, I get what you mean now! Thanks alot! It's finally working. Have a great day! 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