내가 셀레늄에 새로운 오전 WebDriver 셀레늄을 사용하여 이미지를 클릭합니다 그것을 확인하고 클릭하기 위해 할 수있는 일은 무엇입니까?방법 알려 부착 screenshot.Can 누군가에 강조 표시 "회원 가입"라는 이미지를 클릭 할 수 없습니다
import java.io.FileInputStream;
import java.io.IOException;
import jxl.Sheet;
import jxl.Workbook;
import jxl.read.biff.BiffException;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.testng.annotations.Test;
public class Registration {
public WebDriver driver1;
public String exepath="C:\\Users\\ADMIN\\Downloads\\chromedriver.exe";
public String filepath="C:\\Users\\ADMIN\\Desktop\\Book1tetsts.xls";
public FileInputStream file;
public String userID;
public String password;
public String Fname;
public String Lname;
private Object wait;
@Test
void formfilling() throws BiffException, IOException, InterruptedException
{
file = new FileInputStream(filepath);
Workbook wb = Workbook.getWorkbook(file);
Sheet sh = wb.getSheet(0); // this is to get the access to Sheet1.
userID= sh.getCell(0,0).getContents();
password= sh.getCell(1,0).getContents();
Fname= sh.getCell(2,0).getContents();
Lname=sh.getCell(3,0).getContents();
System.setProperty("webdriver.chrome.driver", exepath);
driver1= new ChromeDriver();
driver1.get("http://www.esevaonline.telangana.gov.in");
synchronized (driver1) {
driver1.wait(15000);
}
driver1.findElement(By.xpath("//*[@id='lhsNav']/a/img[@src='images/register2.gif']")).click();
//UserID
driver1.findElement(By.xpath("/html/body/center/form/table/tbody/tr[2]/td/div/center/table/tbody/tr[1]/td[2]/input")).sendKeys(userID);
//Password
driver1.findElement(By.xpath("/html/body/center/form/table/tbody/tr[2]/td/div/center/table/tbody/tr[2]/td[2]/input")).sendKeys(password);
//Re-Type Password
driver1.findElement(By.xpath("/html/body/center/form/table/tbody/tr[2]/td/div/center/table/tbody/tr[3]/td[2]/input")).sendKeys(password);
driver1.findElement(By.xpath("/html/body/center/form/table/tbody/tr[2]/td/div/center/table/tbody/tr[5]/td[2]/input")).sendKeys(Fname);
//LastName
driver1.findElement(By.xpath("/html/body/center/form/table/tbody/tr[2]/td/div/center/table/tbody/tr[6]/td[2]/input")).sendKeys(Lname);
//DOB
}
}
유는 – Gobi