Hi there,
I have some issues with looping my script.
The goal is to do the script for every opened tab. Once the script is finished for the current tab, kantu should go to the next one and execute the script and repeat it to the last opened tab.
Here is the script:
{
“CreationDate”: “2018-5-28”,
“Commands”: [
{
“Command”: “clickAndWait”,
“Target”: “name=edit”,
“Value”: “”
},
{
“Command”: “select”,
“Target”: “id=00N80000003Lv1c”,
“Value”: “label=Recommended”
},
{
“Command”: “clickAndWait”,
“Target”: “name=save”,
“Value”: “”
},
{
“Command”: “selectWindow”,
“Target”: "tab=${!LOOP} ",
“Value”: “”
}
]
}
In order to loop it I click on play loop (upper right corner). The values which I type are:
start: 1
Max: 5
At first, it seems to work, however something is not right and I have no idea what it is since this script is very basic. After running it via ‘play loop’ it runs the script as follows:
1st tab - OK
2nd tab - ok
3rd - SKIPPED
4th- ok
5th - SKIPPED
6th - SKIPPED
7th - it is running twice and then stops
I have no clue whats wrong, I thought that it will start on the second tab (since the starting value is usually 0, but it seems not to apply here) and end on the 6th tab.
Below are the logs:
status]
Playing macro recomend test
[info]
Executing: | clickAndWait | name=edit | |
[info]
Executing: | select | id=00N80000003Lv1c | label=Recommended |
[info]
Executing: | clickAndWait | name=save | |
[info]
Executing: | pause | 2000 | |
[info]
Macro was stopped manually (Runtime 44.33s)
[status]
Playing macro recomend test
[info]
Executing: | clickAndWait | name=edit | |
[info]
Executing: | select | id=00N80000003Lv1c | label=Recommended |
[info]
Executing: | clickAndWait | name=save | |
[info]
Executing: | selectWindow | tab=${!LOOP} | |
[status]
Current loop: 2
[info]
Executing: | clickAndWait | name=edit | |
[info]
Executing: | select | id=00N80000003Lv1c | label=Recommended |
[info]
Executing: | clickAndWait | name=save | |
[info]
Executing: | selectWindow | tab=${!LOOP} | |
[status]
Current loop: 3
[info]
Executing: | clickAndWait | name=edit | |
[info]
Executing: | select | id=00N80000003Lv1c | label=Recommended |
[info]
Executing: | clickAndWait | name=save | |
[info]
Executing: | selectWindow | tab=${!LOOP} | |
[status]
Current loop: 4
[info]
Executing: | clickAndWait | name=edit | |
[info]
Executing: | select | id=00N80000003Lv1c | label=Recommended |
[info]
Executing: | clickAndWait | name=save | |
[info]
Executing: | selectWindow | tab=${!LOOP} | |
[error][ignored]
failed to find the tab with locator ‘tab=4’
[status]
Current loop: 5
[info]
Executing: | clickAndWait | name=edit | |
[error]
time out when looking for element ‘name=edit’
[info]
Macro failed (Runtime 45.40s)
Please explain why it is skipping 3 tabs and on the last one, it runs twice? How to amend this? Is it possible to run the script in the loop for EVERY opened tab without specifying the values? I mean I will open plenty of tabs, let’s say 20, and I don’t want to count them, I want the software to run the script for every opened tab. Is it doable? If yes how to proceed with it?