How to check if a variable exist in browser

I have a variable thats has a string. And i have a browser where i want to check if that variable its equal a element in that browser, how can that be perromed ?

Hi @langsem
–use find text position activity buddy
this would give us a output variable of type uielement
–then use element exists activity and pass the above output variable as input here to ELEMENT property
–the output of element exists will be a boolean and if any text is found on it, it will return true from element exists, of if the text is not found, eve the Find text position activity will give us exception, so place the above activities in Try block of Try catch block and mention the log in catch block if no element is found with log message activity in the catch block
Cheers @langsem

1 Like

Well, did not work as expected. The thing its that my output its NORDEA FINANS NORGE AS. Its taken from the left green side. The grey side with the red circle around its a list of customers. So If the customer exist in that list i want to click that customer, if not then i want to perfrom another action. I just need a match function. Where my varible checks if its match in the customer list or not

Can you try to Fetch the value of that field using Get Text Activity or Get Attribute activity,store the value in variable then Compare the both values.

  1. Use get text activity to get the customer name from the green box
  2. Use a select item activity with the parameter “*”+scraped customer name
  3. surround the select item with a try/catch and put your additional actions in the catch part if the name cannot be selected

You could always try Get Full Text to scrape the entirety of the pick list and do a lookup on that list for the customer name