2017-10-25 1 views
-2

온라인 서적을 읽으려고합니다. 웹 사이트에서 Flash를 사용 중입니다. 내가 드라이버의 초기화 함수에이 줄을 추가했지만 그것은 작동하지 않습니다 pic크롬 브라우저 알림에서 허용 버튼을 클릭하는 방법은 무엇입니까? C#

:

ChromeOptions options = new ChromeOptions(); 
options.AddUserProfilePreference("profile.default_content_setting_values.notification", 1); 
IWebDriver driver = new ChromeDriver(options); 
+3

크롬 설정에서 플래시를 모두 허용하는 것이 더 쉬울까요? – Steve

+0

이 셀레늄입니까? 또는 다른 것? –

+0

@Steve 셀레늄은 각 실행에 대해 새 프로필을 만듭니다. –

답변

0

을 대신의 Allow 클릭 내가 웹 사이트로 이동하는 경우 , 나는 브라우저의 팝업을 얻을 버튼 우리는 Test Execution 시작할 때마다, 우리는 쉽게 WebDriver 인에 의해 시작 Chrome Browser Instances 모두에 대한 Flash을 활성화 할 수 있습니다 다음과 같이 눈금을 매기십시오 :

Map<String, Object> prefs = new HashMap<String, Object>(); 
prefs.put("profile.default_content_setting_values.plugins", 1); 
ChromeOptions options = new ChromeOptions(); 
//crosscheck if the option switch is C# compatible (this is definately Java compatible) 
options.setExperimentalOption("prefs", prefs); 
WebDriver driver= new ChromeDriver(options); 
driver.get("<to_desired_page>"); 
+0

변수를 2로 설정하면 옵션이'block'으로 바뀌지 만 변수를 1로 설정하면 여전히'ask' 옵션이 표시됩니다. – Sean

+0

'allow'옵션을 켜는 방법은 무엇입니까? – Sean

관련 문제