Below are the CSS Selector codes I am using:
driver.findElement(By.cssSelector("button[class='btn-link'][data-sugg-technik='append_numbers']")).click();
driver.findElement(By.cssSelector("button[class='btn-link'][data-sugg-technik='make_pairs']")).click();
These selectors are functional, and now I want to focus on these elements using Selenium. Is there a way to achieve this?
Edit:
js.executeScript("document.querySelector('button.btn-link.make_pairs').focus();");
Although this code works, it always focuses on the first item, which is not my desired outcome.
<li>
<button class="btn-link" data-sugg-sources="email,full_name" data-sugg-technik="make_pairs">AlZehraala16</button>
</li>
I specifically want to focus only on this button element.