Get url activity issues

Hi,
I’ve create a robot that do a click activityin a main webpage then a new window is opened and I would like to get the url of the new window,but the robot the url of the main window.

note that the seconde url change every time and I try it with attach window and I use the (*) in the selector to change it to dynamic selector.
selector

help please

Hi @noussair_prof

If your question is when click on any element on main screen it will redirect to another page and do the automation on that page.

Then use the use application\browser activity to indicate the second screen.
In properties of Use application\browser activity give the below options.

  • Close → Always
  • Open → If not open
  • Application instance → Single window.

For this better to use the modern activities. The Use application\browser activity is the modern design activity

Hope it helps!!

@noussair_prof

Is the new window being opened and coming into visible without using the attach window?

Regards

Hi @noussair_prof

You cannot use the get URL activity in classic version activities. So, here the attach browser won’t work. remove the attach browser and place the get URL activity with use browser or application activity and please do the necessary changes so that you can get the URL.

Change the below settings as:

Close ----------- NAppCloseMode.Never
Input Mode --------- Simulate
Open ----------- NAppOpenMode.IfNotOpen
Window attach mode --------- single window


Hi, no the question is how to get the url of the seconde page

Yes, it works but the get url activity get the first url and not the second url
The attach browser doesn’t change anything

@noussair_prof

I have given a workflow in that the use browser/application should be passed with first url and the click activity will be done and the second page will be opened. So then the get URL will extract the URL of the new page loaded.

This is the flow you wanted right?

Regards

When redirect to second screen inside use application/browser place the get URL activity. After getting the URL it comes out to main page.

Hope you understand!!

Hi @noussair_prof

Please follow the above mentioned flow you will get the output as per your requirement.

Regards

Hi @noussair_prof

  1. After the click activity on the main webpage, use the “Attach Browser” activity to target the newly opened window. To do this, click on the “Indicate window on screen” button and select the new window that appears after the click.
  2. Once the new window is attached, use the “Get Attribute” activity inside the “Attach Browser” container. Set the following properties for the “Get Attribute” activity:
  • Selector: Leave it empty. Since you’re already attached to the new browser window, you don’t need to specify a selector here.
  • Attribute: Select “url” from the dropdown list. This will retrieve the URL of the newly opened window.
  1. Create a variable (let’s call it newWindowURL) to store the URL retrieved from the “Get Attribute” activity.
  2. To get the URL, use an Assign activity to assign the value to the newWindowURL variable. The value can be obtained using the Get Attribute output property called “result”. So, in the Assign: newWindowURL = Get Attribute's output result

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.