Sign in to follow this  
Followers 0
mrjgs70

Locating text within a control window

9 posts in this topic

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.

Share this post


Link to post
Share on other sites



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áÐ ÅÕ½ÐíѥѱÅÕ½Ðì°ÅÕ½ÐíÑáÐÅÕ½Ðì°½¹Ñɽ±%¤

Share this post


Link to post
Share on other sites

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áÐ ÅÕ½ÐíѥѱÅÕ½Ðì°ÅÕ½ÐíÑáÐÅÕ½Ðì°½¹Ñɽ±%¤

Share this post


Link to post
Share on other sites

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

Q. Are you trying to get the text from a button?

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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]

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

...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]

Share this post


Link to post
Share on other sites

...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

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0