syntaxing Posted June 27, 2018 Share Posted June 27, 2018 I am trying to automate SAP without GUI scripting enabled by doing everything through MouseClicks. It's not the cleanest solution but it works pretty well so far. I noticed that ControlClick actually has the option to put control coordinates in the parameters. I tried it and this works great since it allows me to run SAP hidden while I run my script. Unfortunately I am only able to click on objects but not send text. Is it possible to do a ControlSend on the object I used ControlClick on? The biggest problem is that there is no control ID on the object since SAP groups everything into one window with weird class IDs (which I cannot find out since I do not have GUI scripting enabled). I've been searching for a solution for a while now and any help would be appreciated! Thanks! Link to comment Share on other sites More sharing options...
Deye Posted June 27, 2018 Share Posted June 27, 2018 syntaxing, welcome to the Autoit forum did you try it without specifying an id ControlSend($hwnd, "", "", "text", 1) Deye Link to comment Share on other sites More sharing options...
syntaxing Posted June 27, 2018 Author Share Posted June 27, 2018 Thank you for the response! I have been using the following code with no luck: $test = WinGetHandle('Change Material') ControlClick($test,'',100,'left',1, 184, 171) ControlSend($test,'',100,'XX') Link to comment Share on other sites More sharing options...
Deye Posted June 27, 2018 Share Posted June 27, 2018 (edited) syntaxing,, Try with whats for "Advanced mode" for the ID ControlClick($test, '', "[Advanced mode]", "left", 1) Deye Edited June 27, 2018 by Deye Link to comment Share on other sites More sharing options...
syntaxing Posted June 27, 2018 Author Share Posted June 27, 2018 Hi Deye, At first I made a silly mistake and literally put in "[AdvancedMode]" into my code... I was super confused why it wasn't working. Interestingly, your code (and my original code) works but only when the window is active somewhere on the screen. I guess SAP is one of those programs that only listens to keystrokes when onscreen. I run two monitors so it's not a deal breaker but now I know my problem! Thank you for all your help! Link to comment Share on other sites More sharing options...
junkew Posted June 27, 2018 Share Posted June 27, 2018 Check within examples on uiautomation and check with simplespy if your elements are highlighted. If so you can do your automation easier. FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets 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