Sanjeevi Posted January 7, 2019 Share Posted January 7, 2019 Hi Team, i am doing automation using Auto IT tool for one of our desktop application which is developed by Dev express controls. I am able to automate as auto installer and login page after that unable to call / fetch any fields. Please suggest me. Best Regards, Sanjeevi Aandi Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted January 7, 2019 Share Posted January 7, 2019 Hi @Sanjeevi, and welcome to the AutoIt forums Could you please post your code? TheSaint 1 Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
Sanjeevi Posted January 9, 2019 Author Share Posted January 9, 2019 On 1/7/2019 at 8:05 PM, FrancescoDiMuro said: Hi @Sanjeevi, and welcome to the AutoIt forums Could you please post your code? Hi Francesco, As its confidential, i can't provide the application name and exact information so i have modified the .exe name and method names. As i said earlier.. I would be able to automate as Auto Installer and Login page and then when trying click on some text of Menu item and Sub menu item which is not working. Please refer the below code and provide the solution for the same. Let me know if you have any question. Please feel free to contact me on Phone: +91 7259444455 Please find the code below: This code is for Login Page and Create user: #RequireAdmin #include <MsgBoxConstants.au3> ;#Include-Once ;-+ ;#Include "_Dbug.au3" ; | ; Opt('MustDeclareVars', 1) Main () Func main() ToolLogin() CreateUser() EndFunc ; End Main() Func ToolLogin() If FileExists ("C:\Program Files (x86)\Caterpillar\demo Tool\demo.exe") Then Run("C:\Program Files (x86)\test\demo Tool\demo.exe") WinWaitActive("Login") ControlSetText("Login", "", "[CLASS:WindowsForms10.EDIT.app.0.34f5582_r9_ad1; INSTANCE:2]", "admin") Sleep(1000) ControlSetText("Login", "", "WindowsForms10.EDIT.app.0.34f5582_r9_ad11", "Test123") Sleep(1000) ControlClick("Login", "Login","WindowsForms10.Window.b.app.0.34f5582_r9_ad14") EndIf EndFunc Func CreateUser() WinWaitActive("The Tool") WinMenuSelectItem("The Tool", "[CLASS:WindowsForms10.Window.8.app.0.34f5582_r9_ad1; INSTANCE:6]","Management") ControlClick("The Tool", "Management", "[CLASS:WindowsForms10.Window.8.app.0.34f5582_r9_ad1; INSTANCE:6]",1) ; ControlClick("The Tool", "Management", 526704) ;Send("Management") ; MouseClick("Management", 109,14) ; ControlClick("The Tool", "Management","",109,14) EndFunc This code is for Auto Installer: #RequireAdmin #include <MsgBoxConstants.au3> ; 1) Obtain the installer (Provide to user) ; 2) Run the Installer (Run the exe) ; 3) Yes to UAC (RequiredAdmin) ; 4) Tool Window Active ; 5) Click Install ; 6) Click Finish Main() Func main() Initialize() AskUser() EndFunc ; End Main() Func Initialize() Global $InstDes = (@TempDir & "\demoTool.exe") Global $InstallSetup = ("Tool Setup") Global $WantInst = (-99) FileInstall("E:\Softwares\AutoIT\demo.exe", $InstDes,1) EndFunc Func AskUser() $WantInst = MsgBox($MB_YESNO, "Install the Tool", "Are you sure you want to install the Tool",5) If $WantInst = $IDYES Then DoInstall() ElseIf $WantInst = $IDTIMEOUT Then DoInstall() Sleep(1000) ElseIf $WantInst = $IDNO Then MsgBox(0,"Cancelled", "Tool Installation has been cancelled") WinClose("Cancelled") EndIf EndFunc ; End AskUser() Func DoInstall() Run($InstDes) WinActivate($InstallSetup) WinWaitActive($InstallSetup) Send("{Enter}") Sleep(20000); WinWaitActive($InstallSetup) Send ("{Enter}") sleep(1000) WinClose($InstallSetup) EndFunc Link to comment Share on other sites More sharing options...
Developers Jos Posted January 9, 2019 Developers Share Posted January 9, 2019 34 minutes ago, Sanjeevi said: 3) Yes to UAC (RequiredAdmin This will not happen as the context is different from the running script. 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...
Sanjeevi Posted January 10, 2019 Author Share Posted January 10, 2019 Hi Je maintiendrai, Thanks for you prompt reply.. see "3) Yes to UAC (RequiredAdmin" this one is commented and just as information and i was able to do auto installer. That is perfectly fine for me. i am facing issue with after login unable to click on any main menu and sub menu.. please look at the below code. guide me on the same. Also i have used couple of methods like ControlClick or MouseClick or Send. Also while execute which are not required i used comment ";" so that it won't execute at that time. I would really appreciate if could provide me the solution or give a call to me for some more information you need. Thanks in Advance. #RequireAdmin #include <MsgBoxConstants.au3> Main () Func main() ToolLogin() CreateUser() EndFunc ; End Main() Func ToolLogin() If FileExists ("C:\Program Files (x86)\Caterpillar\demo Tool\demo.exe") Then Run("C:\Program Files (x86)\test\demo Tool\demo.exe") WinWaitActive("Login") ControlSetText("Login", "", "[CLASS:WindowsForms10.EDIT.app.0.34f5582_r9_ad1; INSTANCE:2]", "admin") Sleep(1000) ControlSetText("Login", "", "WindowsForms10.EDIT.app.0.34f5582_r9_ad11", "Test123") Sleep(1000) ControlClick("Login", "Login","WindowsForms10.Window.b.app.0.34f5582_r9_ad14") EndIf EndFunc Func CreateUser() WinWaitActive("The Tool") WinMenuSelectItem("The Tool", "[CLASS:WindowsForms10.Window.8.app.0.34f5582_r9_ad1; INSTANCE:6]","Management") ControlClick("The Tool", "Management", "[CLASS:WindowsForms10.Window.8.app.0.34f5582_r9_ad1; INSTANCE:6]",1) ;or ; ControlClick("The Tool", "Management", 526704) ;or ;Send("Management") ;or ; MouseClick("Management", 109,14) ; ControlClick("The Tool", "Management","",109,14) EndFunc Link to comment Share on other sites More sharing options...
Developers Jos Posted January 10, 2019 Developers Share Posted January 10, 2019 (edited) 6 hours ago, Sanjeevi said: Hi Je maintiendrai, AS to the UAC... that will not work. Edited January 10, 2019 by 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...
Sanjeevi Posted January 11, 2019 Author Share Posted January 11, 2019 I am not getting clearly, what are you trying to say.. could you please elaborate ? Thanks in advance. See i have two separate program, 1st program is Auto installer and 2nd program is Login page with create user. 1st program - i am using with "#RequireAdmin" to install the tool. 2nd program i am not using "#RequireAdmin" as i dont want. Please explain me in detail to move further. Thanks in advance. Link to comment Share on other sites More sharing options...
orbs Posted January 11, 2019 Share Posted January 11, 2019 hello @Sanjeevi, welcome to the AutoIt forum. first - your topic title is correct. AutoIt indeed does not directly support DevExpress controls. second - when you post code to this forum, please use the code tags (the icon looking like < > in the toolbar). third - disregard the UAC thing. as long as you have #RequireAdmin at the top of your script, UAC prompt is triggered before the script even begins, so the entire script is already elevated. and finally - google "autoit devexpress" yields some interesting results, especially this article from the DevExpress support forum, stating that DevExpress might support UIAutomation (which AutoIt does support, with an additional UDF pinned to the top of the "Example Scripts" forum). this article also mentions their "Coded UI Test Extension", which i know nothing about but might be useful to you. FrancescoDiMuro 1 Signature - my forum contributions: Spoiler UDF: LFN - support for long file names (over 260 characters) InputImpose - impose valid characters in an input control TimeConvert - convert UTC to/from local time and/or reformat the string representation AMF - accept multiple files from Windows Explorer context menu DateDuration - literal description of the difference between given dates Apps: Touch - set the "modified" timestamp of a file to current time Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes SPDiff - Single-Pane Text Diff Link to comment Share on other sites More sharing options...
Sanjeevi Posted January 11, 2019 Author Share Posted January 11, 2019 Hi Orbs, Thank you so much for the detailed information and also the suggestion of "Coded UI Test Extension. I will go through this and come back if i have any other question. Best Regards, Sanjeevi Aandi 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