Validate UI Selector - Make Selector Dynamic for Salesforce

FYI : i have to replace the tag Angled brackets with Square brackets or the post wont appear.

I am working on Automating Salesforce; I have to use the GET TEXT activity to read the country name from Salesforce, However, the selector does not validate when I open a new product page. I have a basic understanding of selectors but I am confused by the tag because I have made some changes and used Wildcards (*). However, when I do so the selector does not validate on the next product page. How can I edit this selector so it works for every product page?

I have also tried using a wild card next to the TITLE and replaced [html app=‘msedge.exe’ title=‘Beaverbrooks Medium Bag FSCM - Rebrand | Salesforce’ /] WITH [html app=‘msedge.exe’ title=’* Salesforce’ /] but still get no joy.

"
[html app=‘msedge.exe’ title=‘Beaverbrooks Medium Bag FSCM - Rebrand | Salesforce’ /]
[webctrl css-selector=‘body>div>div>section>div>div>div>div>div>div>div>div>div>one-record-home-flexipage2>forcegenerated-adg-rollup_component___force-generated__flexipage_-record-page___-product_-record_-page___-product__c___-v-i-e-w>forcegenerated-flexipage_product_record_page_product__c__view_js>record_flexipage-record-page-decorator>div>records-record-layout-event-broker>slot>slot>flexipage-record-home-template-desktop2>div>div>div>slot>flexipage-component2>slot>flexipage-tabset2>div>lightning-tabset>div>slot>slot>flexipage-tab2>slot>flexipage-component2>slot>records-lwc-detail-panel>records-base-record-form>div>div>div>div>records-lwc-record-layout>forcegenerated-detailpanel_product__c___01258000000vlotaag___full___view___recordlayout2>records-record-layout-block>slot>records-record-layout-section>div>div>div>slot>records-record-layout-row>slot>records-record-layout-item>div>div>div>span’ idx=‘4’ parentid=‘sectionContent-166’ parentname=‘tabs’ tag=‘SPAN’ /]
"

Here is the UI Selector code for another product - [<html app=‘msedge.exe’ title=‘Beaverbrooks Large Bag FSCM - Rebrand | Salesforce’ /]
[webctrl css-selector=‘body>div>div>section>div>div>div>div>div>div>div>div>div>one-record-home-flexipage2>forcegenerated-adg-rollup_component___force-generated__flexipage_-record-page___-product_-record_-page___-product__c___-v-i-e-w>forcegenerated-flexipage_product_record_page_product__c__view_js>record_flexipage-record-page-decorator>div>records-record-layout-event-broker>slot>slot>flexipage-record-home-template-desktop2>div>div>div>slot>flexipage-component2>slot>flexipage-tabset2>div>lightning-tabset>div>slot>slot>flexipage-tab2>slot>flexipage-component2>slot>records-lwc-detail-panel>records-base-record-form>div>div>div>div>records-lwc-record-layout>forcegenerated-detailpanel_product__c___01258000000vlotaag___full___view___recordlayout2>records-record-layout-block>slot>records-record-layout-section>div>div>div>slot>records-record-layout-row>slot>records-record-layout-item>div>div>div>span’ idx=‘4’ parentid=‘sectionContent-191’ parentname=‘tabs’ tag=‘SPAN’ /]

UI selector Code for Product A’s page

Hello,

Have you tried the Ui explorer? Better to validate your selectors in Ui Explorer and you can give * where ever you find a dynamic value in the selector.