Dear All:
When I open an browser and click Ctrl + Shift +I or F12, then I click "Toggle device toolbar" button or Ctrl + Shift + M. I get following screen.
Pay attention to the bigger red box. The grey circle is my mouse cursor. I can drag the page on this mode.
But when I open browser by mobile emulation as following java code, I get a page without drag ability.
Who knows how to make it can be dragged by code?
System.setProperty("webdriver.chrome.driver", userPath + sSeperator + "drivers\\chromedriver.exe");
Map<String, Object> mobileEmulation = new HashMap<String, Object>();
mobileEmulation.put("deviceName", "iPhone X");
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);
driver.get("https://m.xxx.com/");
driver.manage().window().maximize();
Thanks a lot !