자바에서 Selenium Webdriver를 사용하고 있습니다. 나는 테이블을 가지고 있으며, 첫 번째 행의 마지막 셀과 마지막 행의 마지막 셀에 손을 넣기를 원합니다. 내가 그 중 하나를 얻을 수셀레늄 WebDriver Java 두 개의 다른 테이블 셀을 찾습니다
WebElement table =driver.findElement(By.className("dataTable"));
List <WebElement> rows = table.findElements(By.tagName("tr"));
WebElement firstrow= rows.get(0);
WebElement lastrow= rows.get(rivit.size()-1);
List <WebElement> firstcells = firstrow.findElements(By.tagName("td"));
List <WebElement> lastcells = lastcell.findElements(By.tagName("td"));
firstcell.get(6).getText());
이것은 내가 td 태그를 두 번 찾고 있기 때문입니다. 두 셀을 멋지게 만드는 방법에 대한 힌트가 있습니까? 내 행이나 셀에 식별자가 없습니다.
여기서 실제 소스를 포함 시키십시오 ... 예를 들면 : lastcell은 무엇입니까? 대신에 그냥'lastcells = lastrow.findElements (By.tagName ("td"));'? – jimaltieri