2013-11-15 1 views

답변

3

Firefox 용 Selenium 드라이버는 기본적으로 a new, anonymous profile with each run을 생성합니다. 따라서 실행 후 프로필과 함께 삭제되므로 설정이 유지되지 않습니다.

당신이해야

:

  • .setPreference("geo.prompt.testing", true);.setPreference("geo.prompt.testing.allow", true);를 사용하도록 FirefoxProfile 인스턴스를 설정합니다.
  • 위의 기본 설정으로 기존 프로필을 설정하거나 명시 적으로 사이트를 허용하십시오. 그런 다음 webdriver.firefox.profile Java System 등록 정보를 설정하거나 public FirefoxProfile(File profileDir) 생성자를 사용하여 기존 프로파일을 사용하십시오.
+0

첫 번째 요점은 나를 위해 일했습니다! 내가 그랬다 : FirefoxProfile profile = new FirefoxProfile(); profile.setPreference ("geo.prompt.testing", true); profile.setPreference ("geo.prompt.testing.allow", true); – Flyview

관련 문제