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.
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 below is a sample script which I have tested it on and the logs. Every script I make and loop behave the same.
tested on: https://a9t9.com/kantu/demo/tabs/1 1
Five the same tabs opened, the same web address on each of them.
loop properties: start value:1, Max:5
Outcome: the same as mentioned in the initial post, skipping tabs 3 and 5
script
{
“CreationDate”: “2018-6-28”,
“Commands”: [
{
“Command”: “type”,
“Target”: “id=sometext1”,
“Value”: “a”
},
{
“Command”: “selectWindow”,
“Target”: “tab=${!LOOP}”,
“Value”: “”
}
]
}
log
[status]
Playing macro TESTS
[info]
Executing: | type | id=sometext1 | a |
[info]
Executing: | selectWindow | tab=${!LOOP} | |
[status]
Current loop: 2
[info]
Executing: | type | id=sometext1 | a |
[info]
Executing: | selectWindow | tab=${!LOOP} | |
[status]
Current loop: 3
[info]
Executing: | type | id=sometext1 | a |
[info]
Executing: | selectWindow | tab=${!LOOP} | |
[error][ignored]
failed to find the tab with locator ‘tab=3’
[status]
Current loop: 4
[info]
Executing: | type | id=sometext1 | a |
[info]
Executing: | selectWindow | tab=${!LOOP} | |
[error][ignored]
failed to find the tab with locator ‘tab=4’
[status]
Current loop: 5
[info]
Executing: | type | id=sometext1 | a |
[info]
Executing: | selectWindow | tab=${!LOOP} | |
[error]
failed to find the tab with locator ‘tab=5’
[info]
Macro failed (Runtime 2.18s)
2. Select command Issue
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 sufficient to pause it and resume, then it will run again.
The issue usually occurs when the macro will go to a different link within a tab. For example
click on edit
fill out the data
click on save
go to the next tab
And in this scenario kantu usually freezes and do not go to the next tab until I click on pause and resume, then it will continue with the script.
website tested: RoboForm Tutorials - Form Filler: Filling Your Information into Online Forms with One Click
Outcome: on the first try script did it a halfway, to the 3rd tab and then I had to pause and resume twice to finish it. After another few tries EVERY time when the script reached the command “select window” it was executed but nothing happened after it, so Kantu was changing to the other tab but did not complete the remaining script. To make it clear - after the selectWindow command is executed the script freezes and I have to pause and resume in order for it to continue. I need to repeat this process every time it reaches the selectWindow command.
Here is the script:
{
“CreationDate”: “2018-6-28”,
“Commands”: [
{
“Command”: “type”,
“Target”: “name=field5”,
“Value”: “aa”
},
{
“Command”: “click”,
“Target”: “name=msradio”,
“Value”: “1”
},
{
“Command”: “click”,
“Target”: “/html/body/div[2]/div/div/div/form/input[2]”,
“Value”: “1”
},
{
“Command”: “selectWindow”,
“Target”: “tab=1”,
“Value”: “”
},
{
“Command”: “type”,
“Target”: “name=field5”,
“Value”: “aa”
},
{
“Command”: “click”,
“Target”: “name=msradio”,
“Value”: “1”
},
{
“Command”: “click”,
“Target”: “/html/body/div[2]/div/div/div/form/input[2]”,
“Value”: “1”
},
{
“Command”: “selectWindow”,
“Target”: “tab=2”,
“Value”: “”
},
{
“Command”: “type”,
“Target”: “name=field5”,
“Value”: “aa”
},
{
“Command”: “click”,
“Target”: “name=msradio”,
“Value”: “1”
},
{
“Command”: “click”,
“Target”: “/html/body/div[2]/div/div/div/form/input[2]”,
“Value”: “1”
},
{
“Command”: “selectWindow”,
“Target”: “tab=3”,
“Value”: “”
},
{
“Command”: “type”,
“Target”: “name=field5”,
“Value”: “aa”
},
{
“Command”: “click”,
“Target”: “name=msradio”,
“Value”: “1”
},
{
“Command”: “click”,
“Target”: “/html/body/div[2]/div/div/div/form/input[2]”,
“Value”: “1”
},
{
“Command”: “selectWindow”,
“Target”: “tab=4”,
“Value”: “”
},
{
“Command”: “type”,
“Target”: “name=field5”,
“Value”: “aa”
},
{
“Command”: “click”,
“Target”: “name=msradio”,
“Value”: “1”
},
{
“Command”: “click”,
“Target”: “/html/body/div[2]/div/div/div/form/input[2]”,
“Value”: “1”
}
]
}
Here are the logs:
[status]
Playing macro TESTS
[info]
Executing: | type | name=field5 | aa |
[info]
Executing: | click | name=msradio | 1 |
[info]
Executing: | click | /html/body/div[2]/div/div/div/form/input[2] | 1 |
[info]
Executing: | selectWindow | tab=1 | |
[status]
Macro paused
[status]
Macro resumed
[info]
Executing: | selectWindow | tab=1 | |
[info]
Executing: | type | name=field5 | aa |
[info]
Executing: | click | name=msradio | 1 |
[info]
Executing: | click | /html/body/div[2]/div/div/div/form/input[2] | 1 |
[info]
Executing: | selectWindow | tab=2 | |
[status]
Macro paused
[status]
Macro resumed
[info]
Executing: | selectWindow | tab=2 | |
[info]
Executing: | type | name=field5 | aa |
[info]
Executing: | click | name=msradio | 1 |
[info]
Executing: | click | /html/body/div[2]/div/div/div/form/input[2] | 1 |
[info]
Executing: | selectWindow | tab=3 | |
[status]
Macro paused
[status]
Macro resumed
[info]
Executing: | selectWindow | tab=3 | |
[info]
Executing: | type | name=field5 | aa |
[info]
Executing: | click | name=msradio | 1 |
[info]
Executing: | click | /html/body/div[2]/div/div/div/form/input[2] | 1 |
[info]
Executing: | selectWindow | tab=4 | |
[status]
Macro paused
[status]
Macro resumed
[info]
Executing: | selectWindow | tab=4 | |
[info]
Executing: | type | name=field5 | aa |
[info]
Executing: | click | name=msradio | 1 |
[info]
Executing: | click | /html/body/div[2]/div/div/div/form/input[2] | 1 |
[info]
Macro completed (Runtime 24.38s)
I would really appreciate your help with this!