Change part of url, and reload the macro openning the new url

Hello,

I’m a beginner, and I don’t know if this is possible :

I would like the following script to run in a loop. BUT, by changing, each time, part of the URL. This one:

“Target”:(…)id=1#entity_menu_client=5",

the id of each round must increase by 1 (id=1, then id=2, … until id=1360).

Is it possible?

I took a break between each round :
“Command”: “pause”,
“Target”: “30000”,

I would like this pause not to be executed, if there was an (ignored) error in the script.

Thanks for your help !

Emeric

You can do this with TIMES command using the variable ${!TIMES} like counter from 1 to 1360 and looping all the script to open all urls

Here example
https://ui.vision/rpa/docs/selenium-ide/times

Thanks,

But how can I ensure that the url of the “open” command is updated with “id=n+1” every round?

Round 1
Open HTTPS:\…id=1#entity_menu_client=5",…

Round 2
Open HTTPS:\…id=2#entity_menu_client=5…

(…)

Round 1360
Open HTTPS:\…id=1360#entity_menu_client=5…

Times command increase +1 every loop and you can use ${!TIMES} to set the loop number

At first loop ${!TIMES} = 1
Open HTTPS:\…id=${!TIMES}#entity_menu_client=5…

At second loop ${!TIMES} = 2
Open HTTPS:\…id=${!TIMES}#entity_menu_client=5…

At last loop ${!TIMES} = 1360
Open HTTPS:\…id=${!TIMES}#entity_menu_client=5…

Good morning,

And thank you very much !

This works fine, but I have a problem with my “pause” line. This one works, but after finishing and ignoring the first error encountered, the “pause” function no longer works, for all other following loops, even if there is no error. I tried gotoif, same prpblem…

Do you have an idea?

Below is the full JSON. Thank you again for your help.
{
“Name”: “Test2”,
“CreationDate”: “2023-10-3”,
“Commands”: [
{
“Command”: “label”,
“Target”: “nodoc”,
“Value”: “”,
“Description”: “”
},
{
“Command”: “times”,
“Target”: “1360”,
“Value”: “”,
“Description”: “”
},
{
“Command”: “open”,
“Target”: “https://xxxxx.fr/fr/scripts/xxxx.php?id=${!times}#entity_menu_client=5”,
“Value”: “”,
“Description”: “”
},
{
“Command”: “store”,
“Target”: “true”,
“Value”: “!errorIgnore”,
“Description”: “”
},
{
“Command”: “click”,
“Target”: “linkText=Sélectionner tous les éléments”,
“Value”: “”,
“Targets”: [
“linkText=Sélectionner tous les éléments”,
“id=ged_select_all”,
“xpath=//[@id="ged_select_all"]",
“xpath=//a[@id=‘ged_select_all’]”,
“xpath=//div[6]/div/div[3]/div[2]/a[2]”,
“css=#ged_select_all”
],
“Description”: “”
},
{
“Command”: “if”,
“Target”: “!${!statusOK}”,
“Value”: “”,
“Description”: “”
},
{
“Command”: “gotoLabel”,
“Target”: “nodoc”,
“Value”: “”,
“Description”: “”
},
{
“Command”: “else”,
“Target”: “”,
“Value”: “”,
“Description”: “”
},
{
“Command”: “click”,
“Target”: "xpath=//
[@id="Client_ged_document"]/div/div[2]/div[6]/div/div[3]/div[4]/form/div/button/div”,
“Value”: “”,
“Targets”: [
“xpath=//[@id="Client_ged_document"]/div/div[2]/div[6]/div/div[3]/div[4]/form/div/button/div",
“xpath=//div[3]/div[4]/form/div/button/div”,
“css=#Client_ged_document > div.ged_container > div.right.seven_tenths_width > div:nth-child(7) > div > div.low_padding.block_contrast > div.low_margin_top > form > div > button > div”
],
“Description”: “”
},
{
“Command”: “type”,
“Target”: "xpath=//
[@id="Client_ged_document"]/div/div[2]/div[6]/div/div[3]/div[4]/form/div/div/ul/li[5]/label/input”,
“Value”: “export_doc”,
“Targets”: [
“name=selectItemged_selection_choice”,
“xpath=//[@id="Client_ged_document"]/div/div[2]/div[6]/div/div[3]/div[4]/form/div/div/ul/li[5]/label/input",
“xpath=//input[@name=‘selectItemged_selection_choice’ and @value=‘export_doc’]”,
“xpath=//div[3]/div[4]/form/div/div/ul/li[5]/label/input”,
“css=#Client_ged_document > div.ged_container > div.right.seven_tenths_width > div:nth-child(7) > div > div.low_padding.block_contrast > div.low_margin_top > form > div > div > ul > li.selected > label > input”
],
“Description”: “”
},
{
“Command”: “click”,
“Target”: "xpath=//
[@id="Client_ged_document"]/div/div[2]/div[6]/div/div[3]/div[4]/form/div/div/ul/li[5]/label”,
“Value”: “”,
“Description”: “”
},
{
“Command”: “pause”,
“Target”: “20000”,
“Value”: “”,
“Description”: “”
},
{
“Command”: “end”,
“Target”: “”,
“Value”: “”,
“Description”: “”
},
{
“Command”: “end”,
“Target”: “”,
“Value”: “”,
“Description”: “”
}
]
}