아래의 웹 페이지에서 "찾아보기" 버튼을 클릭해야합니다.Selenium webdriver를 사용하여 "찾아보기"버튼을 클릭 할 수 없습니다.
http://www.guru99.com/freelancing.html
나는 아래의 코드를 작성하지만, 찾아보기 버튼 요소를 찾기 위해 webdriver 실패했다. 도와주세요.
import java.io.IOException;
import org.openqa.selenium.By;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
public class FileUpload {
public static void main(String[] args) throws IOException {
System.setProperty("webdriver.gecko.driver", "C:\\Eclipse\\Drivers\\geckodriver.exe");
WebDriver driver = new FirefoxDriver();
driver.navigate().to("http://www.guru99.com/freelancing.html");
driver.findElement(By.id("theFile_link(Resume)")).click();
//Below line execute the AutoIT script
Runtime.getRuntime().exec(System.getProperty("user.dir")+"\\FileUpload.exe");
driver.close();
}
}
내가 사용하고 있습니다 :
파이어 폭스 버전 : 49.0.1
셀레늄 버전 : 버전 3.0.0-beta4
OS : Win10 64 비트
자바 : 1.8
티켓을 예외 로그로 업데이트하십시오. 또한 왜 그 버튼을 클릭하고'/ input [@ id = "theFile_property (Resume) _1] 파일 경로를 보내는 대신'AutoIT' 스크립트를 실행하려고하는지 알려주십시오. – Andersson
여기서 관련 HTML을 다음과 같이 공유 할 수 있습니까? 잘 –