Selecting the required option from the drop-down menu

Hello,

I have such a problem:

I log in to the site with different user information. When I click on the username after logging in, 2, 3 or 4 options are presented in the drop-down list depending on the user’s status. Which option I click depends on the user. The only way to explain it to the robot is to give the command to select the option with defined “TAX ID” number among the option texts in the drop-down menu.

I want to set up the logic like this:

If the name of user A is written on the button, select the option with the value 12345 in the text from the drop-down menu.

How do I do this?

Hi @aykhan.rahimli ,

If you are aware of the user names and the corresponding options. You can consider the following methods,

  1. using a dictionary variable to store the UserName and Corresponding Option.
    Eg : Dict1 [“User1”:“Option1”,“User2”:“Option2”,“User3”:“Option3”] , Simple Dict1(“User1”) would give “Option1” which you can pass to select the option.

  2. A switch case to check which user is used currently and determine the corresponding Option.

Hope this helps you to solve the challenge you are facing.

Thanks,
Gautham.