Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in DevOps and Agile by (19.7k points)

I have a web page with a form and has a field that uses the jquery autocomplete function.

enter image description here

This is how the HTML renders after a user name returns 1 or more results.

However I cannot figure out how to make Selenium "click" a result.

enter image description here

Can I do a jQuery type of selector. e.g.

$(".ul.ui-autocomplete li:first a")

1 Answer

0 votes
by (62.9k points)

You can try any of the options below: 

By Xpath:

 button[@type='submit']

button[@class='btn btn-success']

button[@type='submit'][@class='btn btn-success']

By CSS selector:

button[type='submit']

button[class='btn btn-success']

button[type='submit'][class='btn btn-success']

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...