나는 학생입니다. Selenium Webdriver를 사용하여 Gmail의 로그 아웃 기능을 자동화하려하지만 그렇게 할 수 없습니다.Selenium Webdriver를 사용하여 Gmail에서 링크를 클릭 할 수 없습니다.
로그 아웃에 두 가지 단계가 있으며 맨 위에 오른쪽 링크를 클릭 한 다음 로그 아웃을 클릭하십시오. 나는 그렇게 할 수 없다. 여기
<span id="gbi4t" style="max-width: 76px; text-align: left;">Mahmood Ali</span>
<a id="gb_71" class="gbqfbb" href="?logout&hl=en&hlor" onclick="gbar.logger.il(9,{l:'o'})" role="button" target="_top">Sign out</a>
내가
거기driver.findElement(By.id("gbi4t")).click(); OR
driver.findElement(By.xpath("//*[@id='gbi4t']")).click();
driver.findElement(By.id("gb_71")).click(); OR
driver.findElement(By.xpath("//*[@id='gb_71']")).click();
몇 가지 아이디어 등의 시도
//*[@id="gbi4t"] -> Clicking that top to get the logout pop up
//*[@id="gb_71"] -> To logout the gmail application
내 XPath는 무엇입니까?
수 없습니다. – Learner
user1177636 맞습니다. Gmail에서 초급자로 일하지 마십시오.이 작업을 수행 할 수있는 오픈 소스 웹 응용 프로그램이 있습니다. 내 대답은 여기를 참조하십시오. - http://stackoverflow.com/questions/15785962/wrong-button-is-clicked- 15787796 # 15787796 – user2087450
에 오류가 발생했습니다. org.openqa.selenium.NoSuchElementException : 요소를 찾을 수 없습니다 : { "method": "id", "selector": "gbi4t" } 명령 지속 시간 또는 시간 초과 : 3.03 초 – Learner