I am attempting to click on 'Log in' but my Selenium code isn't working. Below is the HTML code.
<span class="css-14krylx-text-text-fullPageText-FormFooter">Already have a Times account?
<span tabindex="0" data-testid="switch-to-login" class="css-dip6gw-link-link-FormFooter">Log in</span></span>
What I attempted so far and did not work?
driver.findElement(By.cssSelector("[data-testid='switch-to-login'")).click();
driver.findElement(By.xpath("//span[@data-testid='switch-to-login'")).click();
driver.findElement(By.cssSelector("/.css-dip6gw-link-link-FormFooter'")).click();
Is there any other approach?