Hi all,
I would like to optimize some of my work which includes doing some repetitive selections in salesforce.
Usually, I am opening 5-10 tabs and running some kantu macros on them. It works, but sometimes it is unreliable and problematic. Below are the problems which I would love to solve with your help!
- Loop acting strangely when trying to work on several tabs.
(The problem was mentioned and not solved under this topic:
New tab loop fails every time - UI.Vision RPA Software Forum | Discuss RPA Automation, Selenium IDE and OCR API Text Recognition)
Problem is always the same - the loop is skipping some tabs, here is a fresh example.
I have opened 10 tabs and run a simple macro, the outcome: macro completed on tabs: 1,2,4 and 7. Everything in between was skipped. Macro has looped on the last tab.
For your reference here is the script which I have tested it on and the logs. Every script I make and loop behave the same, so this is only for your reference.
{
“CreationDate”: “2018-6-27”,
“Commands”: [
{
“Command”: “clickAndWait”,
“Target”: “name=edit”,
“Value”: “”
},
{
“Command”: “clickAndWait”,
“Target”: “name=cancel”,
“Value”: “”
},
{
“Command”: “selectWindow”,
“Target”: “tab=${!LOOP}”,
“Value”: “0”
}
]
}
[status]
Playing macro 1111
[info]
Executing: | clickAndWait | name=edit | |
[info]
Executing: | clickAndWait | name=cancel | |
[info]
Executing: | selectWindow | tab=$+1{!LOOP} | 0 |
[error][ignored]
invalid tab offset, ‘$+1{!LOOP}’
[status]
Current loop: 2
[info]
Executing: | clickAndWait | name=edit | |
[info]
Executing: | clickAndWait | name=cancel | |
[info]
Executing: | selectWindow | tab=$+1{!LOOP} | 0 |
[error][ignored]
invalid tab offset, ‘$+1{!LOOP}’
[status]
Current loop: 3
[info]
Executing: | clickAndWait | name=edit | |
[info]
Executing: | clickAndWait | name=cancel | |
[info]
Macro was stopped manually (Runtime 24.50s)
[status]
Playing macro 1111
[info]
Executing: | clickAndWait | name=edit | |
[info]
Executing: | clickAndWait | name=cancel | |
[info]
Executing: | selectWindow | tab=${!LOOP} | 0 |
[status]
Current loop: 2
[info]
Executing: | clickAndWait | name=edit | |
[info]
Executing: | clickAndWait | name=cancel | |
[info]
Executing: | selectWindow | tab=${!LOOP} | 0 |
[status]
Current loop: 3
[info]
Executing: | clickAndWait | name=edit | |
[info]
Executing: | clickAndWait | name=cancel | |
[info]
Executing: | selectWindow | tab=${!LOOP} | 0 |
[status]
Current loop: 4
[info]
Executing: | clickAndWait | name=edit | |
[info]
Executing: | clickAndWait | name=cancel | |
[info]
Executing: | selectWindow | tab=${!LOOP} | 0 |
[error][ignored]
failed to find the tab with locator ‘tab=4’
[status]
Current loop: 5
[info]
Executing: | clickAndWait | name=edit | |
[status]
Macro paused
[status]
Macro resumed
[status]
Current loop: 5
[info]
Executing: | clickAndWait | name=edit | |
[info]
Executing: | clickAndWait | name=cancel | |
[info]
Executing: | selectWindow | tab=${!LOOP} | 0 |
[error][ignored]
failed to find the tab with locator ‘tab=5’
[status]
Current loop: 6
[info]
Executing: | clickAndWait | name=edit | |
[info]
Executing: | clickAndWait | name=cancel | |
[info]
Executing: | selectWindow | tab=${!LOOP} | 0 |
[error][ignored]
failed to find the tab with locator ‘tab=6’
[status]
Current loop: 7
[info]
Executing: | clickAndWait | name=edit | |
[info]
Macro was stopped manually (Runtime 73.74s)
- The second problem is with the solution which I figured out for the above looping problem. Instead of looping a single script I have replicated it several times and ended with the following lines:
“Command”: “selectWindow”,
“Target”: “tab=1”, (then 2,3 and so on)
It usually works, but often times it just stops. For example, it will execute the script perfectly for the first and second tab, but after that, it will stop and not go to the 3rd tab or do anything else. There is no error, just no action.
There is no rule for it, sometimes it will execute the whole script for every tab, sometimes it will stop on the 3rd or 5th. When it stops its sufficent to pause it and resume, then it will run again.
What can cause that and how to amend it?
- The 3rd problem, sometimes when working on several tabs I see “Either a played tab or a url must be provided to start playing” error. I am usually running the script through the bookmark to ensure it will be played to the correct tab but still this sometimes shows up.
How to ensure that the script will run on the current opened tab? Is there a way to show Kantu on which tab it should work on without typing an exact URL to the script?
I have 2 screens and on each, there is one web browser window, one I would like to dedicate for kantu macros and the 2nd one for other actions. Is there a way to show the program that is should focus only on one browser window, and ignoring the 2nd one completely?
Thank you for your help!