[C#] [테스트 검수중] .Net 환경에서 Selenium을 사용하여 모바일 UI 구현 > C#

본문 바로가기

C#

[C#] [C#] [테스트 검수중] .Net 환경에서 Selenium을 사용하여 모바일 UI 구현

회원사진
하나를하더라도최선을
2020-05-22 16:10 2,095 0

본문



c #을 사용하는 .Net 환경에서 Selenium을 사용하여 모바일 UI 테스트를하고 있습니다.

세로 모드에서 크롬 모바일 에뮬레이션을 사용하여 테스트를 성공적으로 수행 할 수 있지만 에뮬레이션을 가로 모드로 설정하는 방법을 찾을 수 없습니다.

테스트하는 동안 프로그래밍 방식으로 회전하고 싶지만 연구를 통해 아직 불가능한 것으로 보입니다.

세로 모드로 작업 중입니다.

        ChromeOptions chromeCapabilities = new ChromeOptions();         



        chromeCapabilities.EnableMobileEmulation("Apple iPhone 6");



        ChromeDriverService service = ChromeDriverService.CreateDefaultService(@"C:\chromedriver");            



        IWebDriver driver = new ChromeDriver(service, chromeCapabilities);

        driver.Navigate().GoToUrl("www.google.com");

그러나 iPhone 에뮬레이션을 가로 방향으로 어떻게 배치합니까?

나는 이것을 시도했지만 작동하지 않고 크기 제한없이 브라우저가 열립니다.

        ChromeMobileEmulationDeviceSettings CMEDS = new ChromeMobileEmulationDeviceSettings();

        CMEDS.Width = 66;

        CMEDS.Height = 37;

        CMEDS.PixelRatio = 1.0;

        CMEDS.UserAgent = "Mozilla/5.0 (iPhone; CPU iPhone OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5376e Safari/8536.25";



        ChromeOptions chromeCapabilities = new ChromeOptions();



        chromeCapabilities.EnableMobileEmulation(CMEDS);



        ChromeDriverService service = ChromeDriverService.CreateDefaultService(@"C:\chromedriver");



        IWebDriver driver = new ChromeDriver(service, chromeCapabilities);

        driver.Navigate().GoToUrl("www.google.com");

어떤 도움이나 조언도 크게 받았습니다! 미리 감사드립니다

댓글목록0

등록된 댓글이 없습니다.
게시판 전체검색