Closed debugger1979 closed 1 month ago
Example of a script:
r.click('Start_menu.png') r.click('Open_file.png')
How can I determine that the first line of the script has already been executed? Do I understand correctly that a screenshot of the screen is compared before the operation and after the operation? If the screenshots do not match, then there is some result after the click and you can set the result of the function to True? Do I understand the logic correctly?
Hello! Conducted the following research on measuring the execution time of a test script: Source data: A qemu/kvm-based virtual machine. AlmaLinux OS 9, office suite R7-Office
The script uses the following algorithm (turbo_mode = True):
Time measurements were performed in 3 ways:
The values obtained:
The analysis of the timer() function showed that no measurements are made inside rpa-python, but simply the contents of the file are read rpa_python.txt , which creates an external tagui component, which presumably contains the execution time of the next request (operation). Logically, it is fair to take time costs directly from the query executor. But it is unclear why the results are so big? Or does it imply other information?
Hi @debugger1979, thanks for raising this! What you said is all correct and valid, I appreciate very much that you shared these replication details.
There was a design choice made to use the timer that is already embedded within the JavaScript engine in TagUI, vs loading the time module in Python to do the same thing. I agree with you the accurate way to measure will be to do it in Python.
I'll watch out to see if anyone else raises this issue, then I'll change the calculation method to use Python. I am hesitant to change for now because it could break backward compatibility for some users because the timings will be different if I push out this change to the new rpa package version.
In the meantime, in addition to using timer() you can also use time module below to calculate the time delta.
import time
start = time.time()
print("hello")
end = time.time()
print(end - start)
I'll close issue for now but will look out if this feature is desired by other users.
Hello! Please help me with the following question. You have described the r.timer() function. According to the description, it measures the execution time of the previous operation. My task is to measure the execution time of the document saving operation. I'm doing the following steps: r.click("Save.png") save_time = r.timer() What does save_time contain? Variants:
How can I evaluate the effective execution time of operations?
I checked the options with turbo = true and without.
The script:
`r.init(visual_automation=True, chrome_browser=False, turbo_mode=True)
start = r.timer() r.click('folder.png')
fin_folder = r.timer() r.click('downloads.png') fin_downlds = r.timer() r.dclick('excel-file.png') fin_dclk = r.timer() r.click('r7_trial_ok.png') fin_trial = r.timer() r.rclick('r7-row2.png') fin_rclick = r.timer() r.click('r7-insert-string.png') fin_click = r.timer() r.keyboard('kljsdhcvfkesdbvfkdjhb[tab]wleqjfcbewkljbhfkewb[tab]qwefdjewabrkgvberkbver[tab]sdfklvjnbsedkfvb[tab]edrfg;vkertmlgnrlnb[tab]wfv,jerbkvfberkbe[tab]weflkjerwkfbekb') fin_write_text = r.timer() r.click('r7-save.png') fin_save = r.timer()
print('start = ' + str(start)) print('folder = ' + str(fin_folder)) print('downloads = ' + str(fin_downlds)) print('dclick = ' + str(fin_dclk)) print('trial = ' + str(fin_trial)) print('rclick = ' + str(fin_rclick)) print('click = ' + str(fin_click)) print('write text = ' + str(fin_write_text)) print('save file = ' + str(fin_save)) print('all = ' + str(start + fin_folder + fin_downlds + fin_dclk + fin_trial + fin_rclick + fin_click + fin_write_text + fin_save))`
turbo = False
start = 0.07 folder = 7.011 downloads = 2.006 dclick = 2.006 trial = 4.117 rclick = 2.013 click = 2.004 writetext = 11.004 save file = 2.006 all = 32.237
turbo = True
start = 0.072 folder = 5.089 downloads = 0.558 dclick = 0.806 trial = 1.88 rclick = 4.192 click = 0.51 write text = 11.306 save file = 0.406 all = 24.819
Do I understand correctly that in turbo mode, manipulations are performed immediately with the found area (button), without the side costs of "moving the mouse"? In general, is it possible to track the execution time of the operation by the application?