The command to press the button is not working as expected. It successfully finds the button, but fails to click on it. The desired behavior is for a native page to open within Gmail upon clicking the button.
Below is the code that attempts to click on the button in the new contacts page of Gmail
Upon inspecting the element, the div tag has attributes such as tabindex="0", aria-label="Email", data-tooltip="Email", and more. The id of this div tag is ":2l" and it belongs to the class "T-I J-J5-Ji T-I-ax7 T-I-Js-IF L3".
System.out.println("Finding Button");
driver.findElement(By.id(":2l")).click();
System.out.println("printing button");
System.out.println(driver.findElement(By.id(":2l")));
System.out.println("Finding button 2");
WebElement composeBtn = driver.findElement(By.cssSelector("div[class='T-I J-J5-Ji T-I-ax7 T-I-Js-IF L3']"));
System.out.println("Clicking button 2");
composeBtn.click();
System.out.println("Button 2 Clicked");
System.out.println(composeBtn.toString());
System.out.println("Finding button 3");
WebElement cBtn = driver.findElement(By.cssSelector("div[class= 'J-J5-Ji T-I-J3 Nz NS']"));
System.out.println("Clicking button 3");
cBtn.click();
If you have any insights or assistance with identifying and troubleshooting this button issue, please feel free to share. Thank you!