728x90
๋ฐ์ํ
private string ratio(String s)
{
string result = "360,640,3.0";
if (s.Contains("SM-N950N"))
result = "1440,2960,3.5";
else if (s.Contains("SM-A920N"))
result = "1440,2960,3.5";
else if (s.Contains("SM-A5035N"))
result = "1440,2960,3.5";
else if (s.Contains("SM-G930N"))
result = "1440,3040,3.5";
else if (s.Contains("SM-N960N"))
result = "1080,2280,3.5";
else if (s.Contains("SM-A505N"))
result = "1080,2400,3.5";
else if (s.Contains("SM-M205N"))
result = "1440,3088,3.5";
else if (s.Contains("SM-G975N"))
result = "1440,3200,3.5";
else if (s.Contains("SM-G973N"))
result = "1440,3040,3.5";
else if (s.Contains("SM-N971N"))
result = "1440,2960,3.5";
else if (s.Contains("SM-N981N"))
result = "1440,3040,3.5";
else if (s.Contains("SM-N986N"))
result = "1080,2280,3.5";
else if (s.Contains("SM-A135N"))
result = "1080,2400,3.5";
else if (s.Contains("SM-E426N"))
result = "1080,2280,3.5";
else if (s.Contains("SM-G988N"))
result = "1080,2400,3.5";
else
result = "1080,2400,3.5";
return result;
}
var options = new ChromeOptions();
string size = ratio(userAgent);
var mobileEmulationSettings = new ChromiumMobileEmulationDeviceSettings
{
UserAgent = userAgent,
Width = (int)(float.Parse(size.Split(',')[0]) / float.Parse(size.Split(',')[2])),
Height = (int)(float.Parse(size.Split(',')[1]) / float.Parse(size.Split(',')[2])),
EnableTouchEvents = true,
PixelRatio = float.Parse(size.Split(',')[2]),
};
options.EnableMobileEmulation(mobileEmulationSettings);
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);
์ถ์ฒ:
https://stackoverflow.com/questions/36338760/c-sharp-selenium-mobile-emulation-in-landscape
C# Selenium Mobile Emulation in landscape
I'm doing some mobile UI testing using Selenium in a .Net environment using c#. I'm able to do testing quite successfully using the chrome mobile emulation in portrait mode, but I can not found ho...
stackoverflow.com
728x90
๋ฐ์ํ
'๐จ๐ผโ๐ป๊ฐ๋ฐ > ์ ๋ ๋์' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
์ ๋ ๋์ - alert, confirm ์์ ์ฐจ๋จ ํ์ฅ ๋๊ตฌ (0) | 2022.11.30 |
---|---|
์ ๋ ๋์ - C#, ์ฌ์ฉ์์ ๊ธฐ์กด ํฌ๋กฌ ํ๊ฒฝ ์กฐ์ํ๊ธฐ (0) | 2022.11.16 |
์ ๋ ๋์ - C#, Select Option ์ ํ (0) | 2022.10.26 |
์ ๋ ๋์ - C#, ์๋ฐ์คํฌ๋ฆฝํธ ์คํ ๊ฒฐ๊ณผ ๊ฐ์ ธ์ค๊ธฐ (0) | 2022.10.26 |
์ ๋ ๋์ - ์บก์ฑ ์ฐํ ๋ชจ๋(Captcha-Impulse) (0) | 2022.10.25 |