Good day! There is a site written in angulyar. It has a sex selection button. I need to select a value by text \ index. Unfortunately, I do not know how to do it.

When trying to select as Select, writes that "Element should have" select "but was" button

code

  • show how you want to choose - Senior Pomidor
  • Now I’m choosing stupid driver.findelement(By.xpath(locator)).click(); driver.findelement(By.linkText("Мужской").click(); driver.findelement(By.xpath(locator)).click(); driver.findelement(By.linkText("Мужской").click(); - Sergey
  • you need to click to open it, then find the By list in the expanded list and then write a method for iterating over these values ​​and selecting - Senior Pomidor
  • can you give the site address? either expand the select list and attach to the answer as text - Senior Pomidor

1 answer 1

Because This is just a button by clicking on which some kind of animation is likely to occur, the work algorithm should be something like the following:

  1. Click on the button;
  2. Wait for the block to draw a drop-down list;
  3. Find the desired item in this block and take action on it.