skaro13 Posted December 7, 2014 Share Posted December 7, 2014 Hi everyone, I'm getting some strange results using ControlSend & ControlSetText to automate some GUI tests. Sometimes, its as if the textbox was filled with the correct text but as soon as I click on it, the text disappear, a bit like place holder text... This happens randomly, as anyone ever had this kind of trouble? Link to comment Share on other sites More sharing options...
Bert Posted December 7, 2014 Share Posted December 7, 2014 (edited) OK, I'm looking into my crystal ball to examine your code.....wait.....I see fog.....I see smoke.....crap. No code. Yo Ernie! Bring me the thing I got from Wal-Mart yesterday....No, the glass eye thing. Yea, that's it! . ....OK...Lets try my remote all seeing eye......it sees something....yep, it sees NOTHING!!!! Piece of junk....now what???? thinking.... thinking... I know! Lets do the old standby that ALWAYS works when someone post for help and wants us to guess - How about you post your code and then we can figure out what the problem is. As you can see, crystal balls and all seeing eyes don't work. Edited December 7, 2014 by Bert The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
computergroove Posted December 7, 2014 Share Posted December 7, 2014 OK, I'm looking into my crystal ball to examine your code.....wait.....I see fog.....I see smoke.....crap. No code. Lets try my remote all seeing eye......it sees something....yep, it sees NOTHING!!!! Lets try something else - you post your code and then we can figure out what the problem is. As you can see, crystal balls and all seeing eyes don't work. lol Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted December 7, 2014 Moderators Share Posted December 7, 2014 Sometimes a program will set their WM_COMMAND etc parameters to catch edit/text changes, if they didn't do it themselves, they remove or replace it with the text that should have been there. I know I've implemented this on a few of my own applications (to prevent easy automation tasks believe it or not). But, I digress, without knowing the app, the code used, or really... anything more than what you've provided, we can only guess. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
skaro13 Posted December 7, 2014 Author Share Posted December 7, 2014 (edited) There's really no elaborate code involved, just a simple ControlFocus and ControlSend... ControlFocus("Location Description", "", "[CLASS:TEXTEDIT; INSTANCE:1]") ControlSend("Location Description", "", "[CLASS:TEXTEDIT; INSTANCE:1]", $riskAddress) In this precise case, these 2 lines are correctly executed and the value of $riskAddress is typed in the Textbox however as soon as this same textbox is clicked, the text typed is cleared (like a placeholder text). This is not the normal behaviour of this textbox. If I type text in it, focus on another control and click back on it, the text already entered is not cleared. The application which I'm trying to automate is developed in VisualAge SmallTalk... Could there be any compatibility issues? I guess it should handle WM messages just like any Java, .Net... apps? Am I missing something? I just wanted to know if anybody had ever encountered this kind of problem. We've used QTP for a long time and never had this kind of problem... Edited December 7, 2014 by skaro13 Link to comment Share on other sites More sharing options...
JohnOne Posted December 7, 2014 Share Posted December 7, 2014 Yes, I've had it, when an application does not want to be automated it employs countermeasures. See SmOke_N comment above. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
computergroove Posted December 7, 2014 Share Posted December 7, 2014 I'm curious if there's an alternative work around in situations like this. Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html Link to comment Share on other sites More sharing options...
JohnOne Posted December 7, 2014 Share Posted December 7, 2014 I'm sure there is, I've never needed to find one though. In my case I just changed to a different app, one which I could easily automate. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted December 7, 2014 Moderators Share Posted December 7, 2014 (edited) There's really no elaborate code involved, just a simple ControlFocus and ControlSend... ControlFocus("Location Description", "", "[CLASS:TEXTEDIT; INSTANCE:1]") ControlSend("Location Description", "", "[CLASS:TEXTEDIT; INSTANCE:1]", $riskAddress) In this precise case, these 2 lines are correctly executed and the value of $riskAddress is typed in the Textbox however as soon as this same textbox is clicked, the text typed is cleared (like a placeholder text). This is not the normal behaviour of this textbox. If I type text in it, focus on another control and click back on it, the text already entered is not cleared. The application which I'm trying to automate is developed in VisualAge SmallTalk... Could there be any compatibility issues? I guess it should handle WM messages just like any Java, .Net... apps? Am I missing something? I just wanted to know if anybody had ever encountered this kind of problem. We've used QTP for a long time and never had this kind of problem... I'm sure QTP doesn't use a "send" method. 1. Good job on focus, but let's see if we can do the change without it. 2. Try ControlSetText instead of ControlSend. 3. Maybe it wants you to do a mouseover/mousedown/mouseup method first... I had an app that once made me "ControlClick" it before I could set its text. Again, it was managing it's application. I have a feeling, the set text should work. Also, I use the _GUICtrl[Edit/Listview/etc] udf functions as much as possible, so much more versatility. Hope this helps, good luck. Edited December 7, 2014 by SmOke_N skaro13 1 Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. 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