2017-09-22 5 views
1

셀레늄 그리드를 통해 원격 드라이버를 초기화 할 때 IE가 각 세션을 깨끗하게 시작할 수 있도록하려고합니다. 이Selenium - RemoteWebDriver를 초기화 할 때 InternetExplorerOptions() 사용

DesiredCapabilities caps = null; 
caps = DesiredCapabilities.internetExplorer(); 
caps.setCapability(InternetExplorerDriver.IE_ENSURE_CLEAN_SESSION, true); 
WebDriver driver = new RemoteWebDriver(new URL("http://10.10.22.126:5555/wd/hub"), caps); 

는 IE는 문제가 발생 이전 테스트에서 쿠키와 각각의 새로운 테스트를 시작하고, 작동하지 않습니다. 나는이

InternetExplorerOptions ieOptions = new InternetExplorerOptions() 
       .destructivelyEnsureCleanSession(); 

바와 같이 here을 지시 구현하기 위해 노력하고 있어요,하지만 난 원격 드라이버로 대신 로컬이 사용하는 방법을 알아낼 수 없습니다. 감사!

+0

:

InternetExplorerOptions ieOptions = new InternetExplorerOptions() .destructivelyEnsureCleanSession(); capabilities.setCapability("se:ieOptions", ieOptions); 

InternetExplorerOptions 클래스로이 기능에 대한 상수를 정의 작동하지? – nullpointer

답변

1

당신은 어느 정도 이러한 방식으로 기능과 옵션을 설정할 수 있습니다 능력으로이`ieOptions`을 설정 않습니다

private final static String IE_OPTIONS = "se:ieOptions"; 
+0

흥미 롭습니다. 그게 무슨 짓을하고 있는지 말해 줄 수 있어요? – kroe761

+0

@ kroe761 그러면 운전자의 능력 중 하나로 옵션이 설정됩니다. – nullpointer

+0

글쎄, 그래,하지만 나는 무엇보다도 "se : ieOptions"에 대해 궁금해하고 있었다. 나는 그걸 가로 질러 본 적이 없어. – kroe761