I have a button displayed on the browser with the following tag which doesn't have ID or a single CSS class name. How can I find the Webelement and add a click to this button.
<button aria-describedby="notes" aria-label="Notes" autofocus="" class="btn btn-primary" role="dialog" type="button">OK</button>
Consider locating the Element by Tag Name. Go to the parent element which has a id or class name and get subelements by tag name (
parentelement.find_element_by_tag_name('button')) which is your buttonBesides that, the button in your example has two classes.
You click on a button via the
.click()command.