Search code examples
selenium-chromedrivercucumber-jvm

can anyone tell me how to click on I am a fresher link using selenium webdriver testing on following url


https://my.naukri.com/account/createaccount?othersrcp=24167&wExp=N&id=

i tried using following syntax:

driver.findElement(By.xpath("//div[@class='box')]//div[@class='freshercont')]//div[@class='icon fresher')]//button[@title='I am a Fresher']")).click();

driver.findElement(By.xpath("//button[@title='I am a Fresher']")).click();


Solution

  • You can try:

        driver.findElement(By.xpath("//button[@name='userType']")).click();
    

    If that doesnt work, use:

        driver.findElement(By.xpath("//button[@value='fresher']")).click();