cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
LogicSmith
Resolver I
Resolver I

web site url needs to be more generic for UI elements

I have captured some UI elements from a web page. That web page has a specific URL, of the form (in my case) of:

 

https://myurl.com/mycompany/application/home

 

This web page and its elements are specific to that URL. However, the elements are generic to all of the pages, not just /home (things like menu expand, menu contract, search, add buttons). And even the elements are generic to all companies, not just the one named mycompany. So, I need to make this more generic - either find a way to use an asterisk in place of mycompany or home. Worst case, I have the company name in a variable. However, in PAD, I see no way to edit the web page address of a UI element - only the things in the dom that define the element.

 

Is there any way to do this?

1 ACCEPTED SOLUTION

Accepted Solutions
Zave
Resolver I
Resolver I

The URL of the website from which you capture the element does not affect the selector of the web element.

If the element is let's say under "html > div ... > div > a" in website A, and you switch websites, that selector will target the corresponding element in website B under that same path.

 

View solution in original post

12 REPLIES 12
Henrik_M
Super User
Super User

Can you show an image of one of your selectors?

Pavel_NaNoi
Continued Contributor
Continued Contributor

Have you tried editing the main container of the UI Elements?

Pavel_NaNoi_0-1664377660046.png

 

LogicSmith
Resolver I
Resolver I

From the UI elements list:

LogicSmith_0-1664377829189.png

If I double-click on the Web Page item, I get this:

LogicSmith_1-1664377948374.png

The URL here is the one I need to make generic, so I can trigger the Menu Expand on any page, for instance. I assume I could add a second selector with different company name, but there could be hundreds of companies. So I added a second selector, which just says Web Page with no URL listed. Maybe then I could make it the default and delete the original one?

Oh if you just have a container selector thats something like desktop > dormcontainer, then I'm fairly certain you just need to make the selectors in the container more generic i.e. not use the first few selector boxes that include the URL rather than bother with the actual container URL, as it doesn't care for the URL, its just using the browser instance.

 

If that's not the case, give me some example websites that I can take a look at and I'll get back to you about it.

LogicSmith
Resolver I
Resolver I

When I do the initial capture of the web page element, it adds the URL to the web page portion of the element. So, that element won't work if shown on another page. But if I then capture a second selector for that web page, it does not add the URL. So, I just capture the second selector, and disable the original selector. Then it seems like it can find the element even on multiple pages. I'm still playing with it, so when 100% sure, I'll annotate this post and close it.

 

Henrik_M
Super User
Super User

Can you share the full selector builder window?

LogicSmith_0-1664542875576.png

This was the original window selector. Note that it includes a URL. I then added a second capture, which only says Web Page... 

LogicSmith_1-1664542976899.png

If I disable the original window selector and add the generic Web Page, PAD can find the UI elements no matter what the URL is. Since the URL changes based on which company I am dealing with, I need this generic ability.

 

Note that this has nothing to do with the element part of the UI element - only the window part.

Henrik_M
Super User
Super User

You are editing a Web Page element. These should never* be opened.

 

You can move your UI elements between your pages by dragging on the three-dot menu. The name of the Web Page element never has any technical function - it is only a name.

 

*There might be some circumstance that I am not aware of...

LogicSmith
Resolver I
Resolver I

The name is not the issue. The issue is: When you first capture a web UI element, it includes the web page URL in the window descriptor. So, elements captured on this page will not work on another page with a different URL, even though they are the same in the DOM. That's because the window descriptor is linked to the URL. Since this URL cannot be edited, the only workaround I've found is to capture a second selector, which does not get the URL, and deactivate the original selector that has the URL.

Henrik_M
Super User
Super User

Which window descriptor?

Zave
Resolver I
Resolver I

The URL of the website from which you capture the element does not affect the selector of the web element.

If the element is let's say under "html > div ... > div > a" in website A, and you switch websites, that selector will target the corresponding element in website B under that same path.

 

LogicSmith
Resolver I
Resolver I

Ah, that would explain it. In every automation system I've used, a UI component consists of both the window and the component within the window. In PAD, the window portion is ignored, and instead the browser window coming back from the launch/attach action is used. When I call to attach the browser, I use a generic partial URL, so it will find it no matter what the latter portion of the URL is. Thanks for pointing that out - had not seen that documented anywhere.

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,122)