Variable in Selector not identifying the browser

I have used the “++” in Selector to use a variable and it was working fine. But when I am using {{}} for the same variable in Selector it is not identifying the browser. Any suggestions?

Hi @jeyaprakasamm,

Can you attach the screenshot of selector?

Thanks,
Neelima.

Hi @jeyaprakasamm

Instead of sending the variable by using ++ or {{}}

Directly use the value part der as shown below

<html title='Archiv*'>

Mark as solution and like it if this helps you :slight_smile:

Happy Automation :raised_hands:

Best Regards
Er Pratik Wavhal :robot::man_technologist:t4: :computer:

Hi Pratik, Thanks for the suggetion. I just tried as a exploratory testing. Actually I want to use or condition to be used in the selector.
Meaning in the above example <html title='Archive*>
I want the UI path to identify the page whatever I give in title. like

but no luck. Any suggestions?

@jeyaprakasamm I just tried the same and it worked for me. Can you check if the variable is in a different Scope. Assign the outermost Scope to the variable and check.

Also make sure the title of the Browser window you want to use starts with “Archiv”. Also which activity are you using ?

could you try and check whether it works for all the conditions. I am using the attach browser activity.

image

@jeyaprakasamm Ohh So you want to use the Or Operator as well. In that case you need to make use of regex pattern making the title as the regex value.

In your case I guess it can be
<html title='{{browser}}' matching:title='regex'/>

Can you Check with this.


a

2 Likes

could you add one more selector here like “Archiv*|Simple*” and let me know how can I achive Attach browser if the title is Archive or Simple

@jeyaprakasamm Just assign the regex value to the browser variable before it is used. If that’s the regex expression always you can assign the browser variable a default value as I have shown above. It should work. Have you tried it?

yes,


image
This is what I am doing. Am I doing anything wrong?

@jeyaprakasamm There is no app attribute :sweat_smile:, app is needed to indicate which browser you are using. Check the Image I provided above. Also the Selector Should appear as how it is in the Image, you Should get a Selector Panel with Indicate, Highlight buttons. Edit part of the Selector needed, do not edit the entire Selector by rewriting it.

I have only the title in the Selector Editor as below.

When I ran the process as you mentioned and got the below error

@jeyaprakasamm Can you show us what are you trying to Indicate? What is the application used? Is it not a Browser like Chrome or Internet Explorer ?

It is Internet explorer but I could not add the attribute “app” in the selector. I am indicating the page in IE which has title as Archive Home. When I try to navigate to other menu items in the application like Search, Admin, Create the title will change respectively.
So I want to keep one variable say “browser” and within that variable I want to use regex. If I achieve this I could able to navigate to all menu items by only one variable.

Note: When I indicate the menu items the only attribute I have is title.

@jeyaprakasamm For Internet Explorer I get the Selector in the below way :

I think the app attribute is essential for it to work

Actually without app attribute I could able to navigate to all the Menu items with only title attribute. even I could use the variable in Selector. Only think is I could not use it as dynamic.

@jeyaprakasamm That is Strange. Do you get the app attribute when using other websites or is it the same when used for all websites as well? And what happens when you add the app attribute like in the image that I have shown, does it give an error?