Jump to content

after created the automation scripts , having weird issues all the time.


 Share

Recommended Posts

Hi All, I'm new with autolt, and yesterday i finished the scripts I want to automate tests on a standalone desktop application, but today when i was trying to open the standalone application a lot of weird behaviors was showing up with the cursor, like if the cursor was always controlled by the automation, but the scripts were not running...does anyone knows what can be happening and how to fix it?

 

Thanks

Jansen

Link to comment
Share on other sites

  • Moderators

@jmendonca Asking folks to troubleshoot your scripts, with no more description than "a lot of weird behaviors" without actually posting your scripts, is generally not a great way to receive help. How about helping us help you and posting your code? ;)

 

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

  • Developers
6 minutes ago, jmendonca said:

does anyone knows what can be happening and how to fix it?

That is the magic you get when running scripts ;)

....but seriously, what exactly did you expect when formulating the question as you did?

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

Hey sorry guys, I should be more specific...what i am trying to mean is, when i click the Go from tools tab everything runs great in the beginning, and then start to have issues like, the cursor keeps going uncontrolled to the wrong specified places...and when i try just open the standalone software the software open like i was controlling through the autolt, but nothing is running on the autolt

 

Link to comment
Share on other sites

The code is huge, the test is to insert an excel range to the software, change tabs inside and keep doing the same and save. I am using the autolt info for positions...so the code is kind big...

#include <Excel.au3>
#include <MsgBoxConstants.au3>
Run(@ScriptDir & 'S:\Dropbox (Stream)\ Optimizer.V1.1.13.bat')
AutoItSetOption('MouseCoordMode', 0)
;right click on the link and clicking "open" to open the application
WinWait(' Optimizer.V1.1.14')
WinActivate(Optimizer.V1.1.14')
MouseClick('secondary', 278, 198, 1, 0)
WinWait(Optimizer.V1.1.14')
MouseClick('primary', 614, 265, 1, 0)
;choose testing database
WinWait(' Optimizer.V1.1.14'')
WinActivate(' Optimizer.V1.1.14'')
MouseClick('primary', 360, 252, 1, 0)
WinWaitActive(Optimizer.V1.1.14'', "User", 3)
Send("t", 0)
MouseClick('primary', 270, 252, 1, 0)
;click on the user login
WinWait(' Optimizer.V1.1.14'')
WinActivate(' Optimizer.V1.1.14'')
MouseClick('primary', 314, 300, 1, 0)
;finding jansen's login
WinWaitActive(Optimizer.V1.1.14'', "User", 4)
Send("jmendonca", 0)
MouseClick('primary', 209, 295, 1, 0)
;click on the start button to open the app
WinWait(' Optimizer.V1.1.14'')
WinActivate(' Optimizer.V1.1.14'')
MouseClick('primary', 320, 338, 1, 0)
;----------------------------------------------------------------------------------------------------
;                                                                                                                                                                     PRODUCTS
;----------------------------------------------------------------------------------------------------
;click on the top drop down menu
WinWaitActive(‘Optimizer.V1.1.14', 4 )
WinActivate(' Optimizer.V1.1.14'')
MouseClick('primary', 504, 68, 1, 0)
;click back on the main field of the drop down menu
Sleep(1500)
MouseClick('primary', 355, 166, 1, 0)
;------------------------------------------
;                               Products - Material
;------------------------------------------
;click on Products on the left panel
WinWaitActive(‘Optimizer.V1.1.14’'," Terminal", 2 )
WinActivate(' Optimizer.V1.1.14'')
MouseClick('primary', 21, 339, 1, 0)
;------------------------------------Excel Block - Start --------------------------------------------
;copy data from a range on excel
Local $oExcel_1 = _Excel_Open()
Local $sWorkbook = "C:\Users\jmendonca\Documents\Autolt\Data_input_new.xls"
Local $oWorkbook = _Excel_BookOpen
WinActivate($sWorkbook)
;maximizing excel page
WinWaitActive(' Excel ', " Excel ", 1)
MouseClick('primary', 1370, 17, 1, 0)
;click File
WinWaitActive(' Excel ', "File ", 3)
MouseClick('primary', 32, 57, 1, 0)
;click open
WinWaitActive(' Excel ', "File", 2)
MouseClick('primary', 46, 180, 1, 0)
;browsing the file
WinWaitActive(' Open ', "Open", 2)
MouseClick('primary', 246, 525, 1, 0)
Send("Autolt", 0)
Sleep(500)
MouseClick('primary', 775, 506, 1, 0)
MouseClick('primary', 246, 525, 1, 0)
Send("Data_input_new", 0)
Sleep(1000)
MouseClick('primary', 775, 506, 1, 0)
;clicking and finding file name
Sleep(2000)
MouseClick('primary', 216, 479, 1, 0)
;~ #comments-end
;switching tabs inside excel
WinActivate(' Data_input_new - Excel')
MouseClick('primary', 140, 1002, 1, 0)
;selecting range inside the excel
Sleep(1000)
WinActivate(' Data_input_new - Excel')
MouseClickDrag('primary', 52, 318, 185, 360, 10)
Sleep(1500)
;copying inside the excel
WinActivate(' Data_input_new - Excel')
MouseClick('primary', 90, 112, 1, 0)
;closing excel sheet
Sleep(1000)
WinActivate(' Data_input_new - Excel')
MouseClick('primary', 1906, 22, 1, 0)
;--------------------------------------------Excel Block - End --------------------------------------
;clicking the paste button on the Products' Material
Sleep(1500)
WinActivate(' Optimizer.')
MouseClick('primary', 260, 196, 1, 0)
;confirming pasting on clipboard
WinWaitActive('  Clipboard Action', " Clipboard Action", 3)
MouseClick('primary', 135, 111, 1, 0)
;accept the new document
WinWait(' Optimizer.')
WinActivate(' Optimizer.')
MouseClick('primary', 135, 191, 1, 0)

 

Edited by Jos
Put it into a codebox
Link to comment
Share on other sites

  • Developers

No additional comments to make other than :  assume you don't know anything about what member jmendonca is doing and then reread both your posts, :)

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

  • Developers

I see we were both typing and posting at the same time. 
Just some advice: I assume you used the recorder to produce this and that is really not the best way to automate a process.

Maybe you can start with what you want to automate so we can point you in the right direction. 

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

  • Moderators

Agree with Jos, @jmendonca automating Excel with mouseclicks is :x, there are far easier ways to do so in AutoIt. If you start with a clear and concise explanation of what application you're working in, and what you're trying to accomplish, and then work backward from there, you will probably receive a lot more help.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

Jos, actually i didn't use the recorder, just used the autolt editor and the autolt info...I did write all scripts just trying to read from the documentation and some simple examples on youtube. So the idea is...I have a standalone desktop application that I need automate. So the steps are:

- choose the user and login;

- click the start to open the software;

- choose the terminal i need to use on a drop down menu on the top navigation bar;

- choose on the left side panel tabs ;

- when the side tabs open i need to open an excel sheet to copy a range of cells and then come back to the software and click to pate

 

I need to do this in 4 side tabs and in the end delete one by one

 

Could you guys help saying the best way to do this kind of procedures and where to research better so i can create the code as accurate a possible?!

 

Thanks again

 

Jansen

Link to comment
Share on other sites

8 minutes ago, Jos said:

I see we were both typing and posting at the same time. 
Just some advice: I assume you used the recorder to produce this and that is really not the best way to automate a process.

Maybe you can start with what you want to automate so we can point you in the right direction. 

Jos

 

4 minutes ago, JLogan3o13 said:

Agree with Jos, @jmendonca automating Excel with mouseclicks is :x, there are far easier ways to do so in AutoIt. If you start with a clear and concise explanation of what application you're working in, and what you're trying to accomplish, and then work backward from there, you will probably receive a lot more help.

Tried to use the ExcelRangeCopyPaste but it was not working for me...maybe need to learn more.

 

Link to comment
Share on other sites

  • Moderators

So let's take your last post step by step and maybe you'll see where the confusion is coming in from lack of info:

10 minutes ago, jmendonca said:

I have a standalone desktop application that I need automate - Which application?

 

Quote

choose the user and login;

click the start to open the software;

Let's start here. Choose the user and login from where, an external source, typing it into a field, etc.? If typing it into a field, what does the AutoIt Window Info Tool (located in the same directory where you installed AutoIt) show you when you hover over that field? The same with "click the start", what does the Window Info Tool show you for that button?

Once we get that far, we can continue.

 

Edited by JLogan3o13

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

49 minutes ago, JLogan3o13 said:

So let's take your last post step by step and maybe you'll see where the confusion is coming in from lack of info:

 

Let's start here. Choose the user and login from where, an external source, typing it into a field, etc.? If typing it into a field, what does the AutoIt Window Info Tool (located in the same directory where you installed AutoIt) show you when you hover over that field? The same with "click the start", what does the Window Info Tool show you for that button?

Once we get that far, we can continue.

 

First i double click on the .exe and the first page, login page, shows...i need to click on the two fields with drop down menu, the database and the second is the user, that is there on the drop down menu as well. After that i click start to open the software under my user's configuration.

 

The Autolt Info shows :

Database Drop Down

 

title Optimizer V1.14

and class ,  as SunAwtFrame

position -1285,57

Size 1295, 999

Style 0x17CF0000

ExStyle 0x00000100

Handle 0x0000000000070FA0

Start button

 

title Optimizer V1.14

and class ,  as SunAwtFrame

position -1287,57

Size 1295, 999

Style 0x17CF0000

ExStyle 0x00000100

Handle 0x0000000000070FA0

Link to comment
Share on other sites

Control is very important for this, so autoit knows where to touch. Most times the ID is the way to go.

screenshot - 15122017-1247.jpg

Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Link to comment
Share on other sites

On 12/15/2017 at 5:54 AM, careca said:

Control is very important for this, so autoit knows where to touch. Most times the ID is the way to go.

screenshot - 15122017-1247.jpg

So do you use the ControlClick Coords? The thing is everytime i try to position the info bull's eye inside the application it doesnt work, it keeps blank...

 

Link to comment
Share on other sites

If Id is blank, the application uses a different kind of GUI, In my sig you find examples

of how you can try to detect and interact with different types of controls.

Im only affraid it's gonna be overwelming.

Can you interact with those controls by keyboard?

If you find a way, with arrows, tab, whatever, we can then replicate the steps in autoit.

Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...