How to handle dynamic url ( Id keeps changing )

Hi Experts,

I need your inputs to overcome the below problem.

I have been given a web application, from where I need to select a category → which opens in a new tab and then I need to download images from the new tab .

Then again go back to old tab and repeat the same process.

I used Use Application/ browser to handle the tabs . But the id value in URL of the second tab keeps changing for every category ( eg : https:app.fp.com/control/viewspecs.aspx?id=3322)

How can I handle this dynamic changing ID in Iteration ?

Hi, @Mathangi_S Use Attach Browser/Use Application with wildcards in the URL selector (e.g. id=*) so it ignores the dynamic part. Or, switch tabs dynamically using Browser/Tab variable instead of relying on fixed URL.

Hi @Mathangi_S

I would indicate the newly opened tab and make sure to include the url in the selector, to make it stand out from the initial URL.
Then make a wildcard just before the id.

<html app='chrome.exe' title='generic title or wildcard' url='https:app.fp.com/control/viewspecs.aspx?id=*' />

Regards
Soren

Hi @SorenB - Tried using wildcard for Id, but the application displays and error , when I use * in the second url ( inside use Application / browser) option.

Please let me know if there are any other methods to handle this .

Every time , when an category is selected, new tab opens with dynamic id’s like

https:app.fp.com/control/viewspecs.aspx?id=3322

https:app.fp.com/control/viewspecs.aspx?id=4749

https:app.fp.com/control/viewspecs.aspx?id=7232

1 Like

Hi, @Mathangi_S Don’t rely on the URL since the id keeps changing. Instead capture each new tab into a Browser/Tab variable when it opens and work on that variable. After downloading just switch back to the parent tab (also stored in a variable). This way you avoid the dynamic ID issue completely.

Hi @arjun.shiroya - can you please provide me an example how to do this ? Am new to this tool and expecting a help to resolve this Issue.

Hey @Mathangi_S I don’t understood the issue like you’re selecting something but can you tell how are you selecting something and if it is opening into new tab then you’re downloading the images and then it closes the tab and this is working fine right for other things on which you’re selecting.
Also i suggest you to extract rhe url and extract the ids using extractedurl.Split(“=”)(1) and store it into a variable then use that variable for dynamic approach.

Cheers