How do I put a XPATH directly into code to select a value from dropdown



can we select a value directly by using XPATH from a dropdown?

How to select an option from drop down


That’s possible. You will need to construct a xpath for the value you need to select from the dropdown. Focus on @id attribute value of the xpath, since, @id uniquely identifies dropdown selections.

I hope this helps.


Yes. you can!

If you know the invoiceplane website, then while creating invoice, the dialog needs you to select the invoice group.
The xpath to choose invoice default would be like this
"//select[@id=‘invoice_group_id’]/option[text()=‘Invoice Default’]";


Sure Let me try this.


I will try this in the solution. Thank so much !