mrjgs70 Posted March 28, 2007 Share Posted March 28, 2007 I'm new to autoit3, and trying to read the forums and documentation, so please be patient. I am trying to automate an application to aid in regression testing. The application is not like the MS applications that allow you to hit buttons based on the first letter of the action (example - Next with !n). I don't want to rely on moving the mouse around to find the areas in the application so it can be used in different environments, but so far, just to get going, when the main window starts with my application, I move the window to position 0,0, then I find the different areas to click, move the mouse there and hit the right mouse button. Is there a way to find certain text within the main window, and when the text is located, make it active and hit the enter key? Otherwise I will have to rely on moving the mouse around within the main window and clicking on the certain areas in order to open up other windows. Thanks much. Link to comment Share on other sites More sharing options...
BrettF Posted March 28, 2007 Share Posted March 28, 2007 I'm new to autoit3, and trying to read the forums and documentation, so please be patient. I am trying to automate an application to aid in regression testing. The application is not like the MS applications that allow you to hit buttons based on the first letter of the action (example - Next with !n). I don't want to rely on moving the mouse around to find the areas in the application so it can be used in different environments, but so far, just to get going, when the main window starts with my application, I move the window to position 0,0, then I find the different areas to click, move the mouse there and hit the right mouse button. Is there a way to find certain text within the main window, and when the text is located, make it active and hit the enter key? Otherwise I will have to rely on moving the mouse around within the main window and clicking on the certain areas in order to open up other windows. Thanks much. Maybe WinGetText ( "title" [, "text"] )oÝ÷ Ø l¢ÚòºÈ§·"wè¶¶Ø^rí®gjgÛaz{kÉ«¢+Ù ½¹Ñɽ±ÑQáÐ ÅÕ½ÐíѥѱÅÕ½Ðì°ÅÕ½ÐíÑáÐÅÕ½Ðì°½¹Ñɽ±%¤ Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
mrjgs70 Posted March 28, 2007 Author Share Posted March 28, 2007 Thanks Bert. The WinGetText returns a 0, and the ControlGetText has no value when the Au3Info is used. I am trying to find specific text within the window, and then {ENTER}, without using mouse control, but I may have to if I can't figure this out. Thanks again. -- john Maybe WinGetText ( "title" [, "text"] )oÝ÷ Ø l¢ÚòºÈ§·"wè¶¶Ø^rí®gjgÛaz{kÉ«¢+Ù ½¹Ñɽ±ÑQáÐ ÅÕ½ÐíѥѱÅÕ½Ðì°ÅÕ½ÐíÑáÐÅÕ½Ðì°½¹Ñɽ±%¤ Link to comment Share on other sites More sharing options...
BrettF Posted March 28, 2007 Share Posted March 28, 2007 Thanks Bert. The WinGetText returns a 0, and the ControlGetText has no value when the Au3Info is used. I am trying to find specific text within the window, and then {ENTER}, without using mouse control, but I may have to if I can't figure this out. Thanks again.-- johnQ. Are you trying to get the text from a button? Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
mrjgs70 Posted March 29, 2007 Author Share Posted March 29, 2007 Q. Are you trying to get the text from a button?Hi Bert, No, the text is not in a button. The application has the different devices within the window, so you position the mouse on the left side on the device you wish, then you can right click the mouse button and "add new". The border of the window has FIle, View, etc, then below the border are on the left side there are the different types of profiles you wish to add. For instance you can position the mouse on the "Host" profile, so "Host" then becomes highlighted, then you can right click the mouse, and there will be a "Add new host" action which then you can hit enter. I tried some of the Win functions and none seem to find the text I am searching for, so don't know if I can use it for this applicaiton. Any help will be appreciated. Thanks in advance!!-- John Link to comment Share on other sites More sharing options...
herewasplato Posted March 29, 2007 Share Posted March 29, 2007 You may be stuck with using OCR. Can you tab and arrow around to the areas of interest? Do keys like Shift-F10 equal the context menu for the highlighted item? [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
mrjgs70 Posted March 29, 2007 Author Share Posted March 29, 2007 You may be stuck with using OCR.Can you tab and arrow around to the areas of interest?Do keys like Shift-F10 equal the context menu for the highlighted item?The Alt key just allows the command set in the application's window border - like File, View, etc... But no keys get the cursor to move into the main window in order to highlight any of the profiles. You might be right, I may be stuck moving the mouse around in order to get to these areas. Thanks.-- John Link to comment Share on other sites More sharing options...
herewasplato Posted March 29, 2007 Share Posted March 29, 2007 ...but you might be stuck with Optical Character Recognition (OCR) as a way of determining where to move the mouse... It would not be an easy script to construct. [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
mrjgs70 Posted March 29, 2007 Author Share Posted March 29, 2007 ...but you might be stuck with Optical Character Recognition (OCR) as a way of determining where to move the mouse... It would not be an easy script to construct.I was able to move the whole applicaton window to coordinate 0,0, and then find the area where I wanted to add something new, and get the mouse position, and then left click, so I can program the mouse around, I was just looking for alternatives. I am hoping that this will work with different environments and possibly different operating systems (2000, xp, vista). Thanks again.john 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