In Gmail Web,unable to access "Create Account" menu Options, "Para mim" throws exception



  • I've tried everything !!. I need to inspect the "for me" from button "Criar Item.

    public void que_eu_esteja_na_pagina_principal_do_gmail() throws Throwable {
        System.setProperty("webdriver.chrome.driver","C:\\Browsers\\chromedriver.exe");
        WebDriver driver = new ChromeDriver();
        driver.get("https://www.gmail.com");
         driver.findElement(By.xpath("//span[contains(text(),'Criar conta')]")).click();
    
        throw new PendingException();
    }
    

    Kindly refer the below for your reference

    enter image description here



  • Try the below code its working for me in gmail.com(UK)

    public static void TestGmail throws InterruptedException {
            System.setProperty("webdriver.chrome.driver","Your driver path");
            WebDriver driver = new ChromeDriver();
            driver.get("https://www.gmail.com");
            driver.findElement(By.xpath("//span[@class=\"I3EnF oJeWuf\"]//span[@class=\"NlWrkb snByac\"]")).click(); //<--Modified xpath
            Thread.sleep(2000);
            driver.findElement(By.xpath("//div[@class=\"xkfVF nnGvjf\"]//div[@class=\"JPdR6b ILYVD qjTEB\"]//span[@class=\"z80M1 G3hhxb\"]//div[@class=\"uyYuVb oJeWuf\"]//div[@class=\"jO7h3c\"]")).click(); //<--Modified xpath
            driver.close();
    }
    

Log in to reply
 

Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2