Attempting to add benchmarking scores after running intensive functions from the tested application.
I would like to do it as such:
benchmarks = []
# Begin intensive process for i in range(0, 5): benchmarks.append(addBenchmark()) time.sleep(1)
compileBenchmark()
What this will do is start something that should take some time to finish, then take five different measurements across five seconds and average them out to get the stats (e.g. time, cpu usage, memory usage, etc).
My question is, I notice that TC sometimes waits for something when it takes a while. While it does so, will it be stuck in
# Begin intensive process
Or will it enter my loop and start recording?
Also, has anyone tried out benchmarking and how did you go about it? I'm currently using psutil.
Solved! Go to Solution.
We have a web application that does something similar... click on a button and you get an overlay object that indicates "Loading..." that, until that goes away, the automation needs to wait. WE built a custom routine that simply checks for that object to be visible... if it is, sleep for 500 ms... loop until that object is no longer visible.
Is that what you're looking for?
Depends on how you handle the waiting. If TC times out without any other instructions, it will stop. If you handle this in your code, then you can describe the conditions for moving on to your loop if that's what you want.
I'd like to avoid it timing out, and instead of it waiting on anything it simply goes off to my loop.
If you say TC times out in this case, does this mean TC parses lines in a way that makes it impossible to enter the loop without the previous line completing?
Hard to know how to advise you without seeing the code. Yes, TC executes the script lines sequentially. It has no way to know how to continue otherwise unless you tell it. It will try to complete each line and then move on if it can. If it can't, it will stop and tell you.
What is in your code that it is waiting on? There may be a simple way around this but making us guess at it is just going to frustrate everyone.
Sorry, should've clarified further.
The action before hand would simply be pressing a button (e.g. Aliases.Program.BeginAction.ClickButton()) or something similar. That action would begin a process that takes time (e.g. the button is to compile and export a spreadhsheet).
It should pass through that line without a failure, but it has a chance of causing the windows application to stall. You might be familiar, it takes up the whole screen and sets cursor to loading. Clicking on the application brings up the dialogue of unexpected issue "Wait for program to respond" or "End process" but you can simply wait for it to execute and it'll go back to normal.
If you need more clarification please let me know 🙂
We have a web application that does something similar... click on a button and you get an overlay object that indicates "Loading..." that, until that goes away, the automation needs to wait. WE built a custom routine that simply checks for that object to be visible... if it is, sleep for 500 ms... loop until that object is no longer visible.
Is that what you're looking for?
Not exactly, but I think you inadvertantly answered my question.
After clicking the button, you're able to move on - so it simply waits for the next object to be called (next line of code). I don't want to change how the program itself waits, so instead I'll be trying something like this:
benchmarks = []
# - Begin intensive process - benchmarks.append(addBenchmark())
while True:
if -WaitWindow that should be clickable after done loading-:
break
else:
benchmarks(append(addBenchmark())
compileBenchmarks(benchmarks)
So thank you for confirming it is possible, I'll get to it.
Hi,
If you are working with the desktop application then you may consider AQtime profiling tool (https://smartbear.com/product/aqtime-pro/overview/). It will provide you not with just a figure of how long did it take to complete intensive process, but also with the detailed timing breakdown.
Subject | Author | Latest Post |
---|---|---|