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

xpath
mouse-click

#1

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


How to select an option from drop down
#2

@mandar.deval

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.


#3

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’]";


#4

Sure Let me try this.


#5

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