M
M
Maxim Isaev2021-03-17 09:21:42
Java
Maxim Isaev, 2021-03-17 09:21:42

How to select an option from a drop down menu?

I need to click on the "Paste Expiration" drop down menu on pastebin.com and select "10 Minutes".

I created

@FindBy(id = "select2-postform-expiration-container")
private WebElement optionPasteExpiration;


Clicking on this element works, a list of options appears. How to choose the right one among them?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Orkhan, 2021-03-17
Hasanly @azerphoenix

Good afternoon!
For example, the element id
select2-postform-expiration-result-cqx3-10M
Here cqx3changes dynamically.
Here, take a look at how you can select an element that changes dynamically - https://sqa.stackexchange.com/questions/18342/how-...
Pay attention to contains() или starts-with()
Here, there is useful information on selecting elements from select
https://www .guru99.com/select-option-dropdown-sele...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question