Lecture 24 : Mobile emulation in chrome in Selenium Webdriver in Java

preview_player
Показать описание
This video explains how to test web application on various emulated mobile devices in chrome browser using Selenium Webdriver
Рекомендации по теме
Комментарии
Автор

Hi Sagar, driver = new ChromeDriver(cap); it says that ChromeDriver(cap) is deprecated. I tried different solution provided in google. Below code is opening websites like desktop web pages not in emulator size. How do I resolve it?

ChromeDriverService service = new ChromeDriverService.Builder()
.usingDriverExecutable(new
.usingAnyFreePort()
.build();
Map<String, String> mobileEmulation = new HashMap<String, String>();
mobileEmulation.put("deviceName", "iPhone X");
Map<String, Object> chromeOptions = new HashMap<String, Object>();
chromeOptions.put("mobileEmulation", mobileEmulation);

DesiredCapabilities cap = DesiredCapabilities.chrome();
cap.setCapability(ChromeOptions.CAPABILITY, chromeOptions);

ChromeOptions options = new ChromeOptions();
options.merge(cap);
driver = new ChromeDriver(service, options);

smithapatil
Автор

Hi sir,
What if i have to test web application on safari emulated device using automation

iqbalsingh
Автор

Hi Sagar, I have a question regard what you have showed here I want to know how to test my browser that the desired device is the one that was launched in other words - How do I verify that the browser that Selenium launched is really of type device x?

erezn
Автор

Hi sir,
Will there any problem while locating the elements? Will this be same for both mobile and desktop.

prateekkakkar
Автор

How can I test a set of emulators all together in the code?

nayanikanandy
Автор

Hi Sagar, No able to lauch mobile view even after folllowing same steps

System.setProperty("webdriver.chrome.driver",
Map<String, String> mobileEmulation =new HashMap<String, String>();
mobileEmulation.put("device Name", "Apple iPhone 5");

Map<String, Object> chromeOptions =new HashMap<String, Object>();
chromeOptions.put("mobileEmulation", mobileEmulation);

DesiredCapabilities capabilities= DesiredCapabilities.chrome();
capabilities.setCapability(ChromeOptions.CAPABILITY, chromeOptions);
WebDriver driver= new ChromeDriver(capabilities);

manjunathdj
Автор

Hi Sagar, i have tried implementing based on your video but i am getting below error. java.lang.StackOverflowError
at Source)
at Source)
at

divyeshtandel
visit shbcf.ru