Sign in to follow this  
Followers 0
naul

Popup Box

21 posts in this topic

#1 ·  Posted (edited)

Hi Guys,

Two Part Question but both related to Pop UP Boxes:  I wanted to know if/how I would be able to do the following;

Q1:

Once the application has started:

A popup box is Displayed Showing "In Progress"

I would like to time the duration taken from the start of the popup box until the words "Ended" are displayed, and the output sent to an external file.

 

Q2:

Also, I would like to read the numerical results displayed within the popup box and store these values within the same external file.

Any help, guidanance, direction would be very much appreciated.

Thanks for looking!

naul

Edited by naul

Share this post


Link to post
Share on other sites



Hi, naul, welcome to the form.

In short, the answer to your question depends on the application generating the pop up box. I would suggest you use the AutoIt Window Info tool (AU3Info or Au3Info_x64, found in the same directory where AutoIt is installed) on the pop up box, to see what information you can retrieve. If you are able to see "In Progress" or "Ended" under the Visible Text tab, then Q1 should be pretty simple. The same goes for Q2, if you can capture the text you can then look in the help file for methods to write it out to the filetype of your choice (see FileWrite, IniWrite). Give it a go, and feel free to post your code if you get stuck.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Thank you for your quick response - Im starting to really love autoit!

 

>>>> Visible Text <<<<
To interrupt the search operation, press Break.
Break
Search in progress...
Objects found: 0
 

>>>> Visible Text <<<<
Would you like to browse results or modify your search?
Browse
Modify
Break
Search ended
Objects found: 50000

Is there a function/method I can use to time the difference in speed between in progerss to ended?  that would be awesome and I will have to make a donation!!!!

Edited by naul

Share this post


Link to post
Share on other sites

Without knowing more about the app, you could try something like this. You may have to play around with it a bit:

#include <MsgBoxConstants.au3>

WinWait("<Title>", "Search in progress...")
    $timer = TimerInit()
WinWait("<Title>", "Search ended")
    MsgBox($MB_SYSTEMMODAL, "", TimerDiff($timer))

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

You guys are awesome!!!  really good - going to play and will update you later in the day...

 

NB:  I'm trying to click Like this on the messages but it says daily quota reached but anywho I liked/loved your replies!!

POETs Day! ;)

Share this post


Link to post
Share on other sites

Agh - I'm missing something,  please could you help!! Sorry the message box doesnt display :(

#include <MsgBoxConstants.au3>

Run("C:Program FilesWinBatchScriptsTestTeststartPROD.exe")
WinWaitActive("Test - User Identification")
Send("john{TAB}")
Send("password{ENTER}")
WinWaitActive("Main Menu")
ControlSetText("Main Menu", "", "[CLASS:Edit; INSTANCE:1]", "football")
ControlCommand("Main Menu", "", "[CLASS:ComboBox; INSTANCE:1]", "SelectString", 'Photo')
ControlClick("Main Menu", "", "[CLASS:Button; INSTANCE:1]")

$hWnd = WinWait("", "Search in progress")
$hTimer = TimerInit()
While 1
  If StringInStr(WinGetText($hWnd), "Search ended") Then Exitloop
Wend
$iDiff = Round(TimerDiff($hTimer)*1000)

;Sleep(10000)
;WinWaitActive("Query result")
;Send ("!{F4}")
;Send ("!{F4}")
;WinWaitActive("Query")
;Send ("{ENTER}")

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

If you want to see a message box then you have to programm it ;-)

MsgBox(4096, "Time", $iDiff)
A-Jay Edited by ajag

Rule #1: Always do a backup         Rule #2: Always do a backup (backup of rule #1)

Share this post


Link to post
Share on other sites

naul, what is the application you're automating? Looking at what you have posted, there may be an easier way to do what you're trying to accomplish.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

o:)  thanks!  ideally I would want the results sent to a text file...  but thats the next step...

Also the number which it returns  i.e. 10799574,  how can I transloate to seonds?

Thanks!!!

Share this post


Link to post
Share on other sites

Hey!

The application is like a web search engine, but windows desktop application used to extract images.  I dont have backend access to the database to execute queries directly and the db is customised apache lucene.

Basically AutoIt is almost there!!  woot!  it launches, authenticates, enters the search term selects type of search (picture) and executes the search.  I'm trying to gather performace metrics for whereby I will add this as a hourly scheduled job and for the results to be output to a file which I can feed into nagios/zabbix:

Thanks for your help!

n.

Share this post


Link to post
Share on other sites

To answer your previous question, time returned is in milliseconds. It looks like you're doing $iDiff * 1000 instead of $iDiff / 1000.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

kay - I modfied

;$iDiff = Round(TimerDiff($hTimer)*1000)
$iDiff = Round(TimerDiff($hTimer)/1000)

To get seconds but I've lost the decimals - but for now its cool!  next step to get this interger into a text file back to the second post and FileWrite, IniWrite!

your guys' help is always welcomed :D

Share this post


Link to post
Share on other sites

You've lost the decimals because you're using Round.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

Simply a FileWriteLine(<name of text file>, $iDiff & " seconds.") should do what you want.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

omg I'm sooooo happy - thank you sooo very much its works beautifully!!!!  think I'll get some cake to celebrate! 

Share this post


Link to post
Share on other sites

lol one more thing - how can I overwrite the content of the text file each time the script is executed - this would be perfect for porting into monitoring and start trending!!! 

 

I have a message on the forum saying only 1 more post allowed today :(

if I can post then just wanted to say I hope you have a very nice weekend indeed!

Share this post


Link to post
Share on other sites

FileWriteLine appends to the end of a file. If you want to overwrite, look at _FileWriteToLine in the help file.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

naul,

I have lifted your "New Member" posting restriction. :)

A good time to remind people of this announcement. ;)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

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