When i inspect manually and set the view port size from responsive, the UI is working fine but when i do it from code, its not showing the exact UI

below is my code used for simulating the UI to mobile view

context = browser.newContext(new Browser.NewContextOptions().setViewportSize(412, 915)
.setDeviceScaleFactor(2.625)
.setIsMobile(true)
.setUserAgent(“Mozilla/5.0 (Linux; Android 11; SM-G988B Build/RP1A.200720.012; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/89.0.4389.105 Mobile Safari/537.36”)
);
page = context.newPage();
page.navigate(PortalURL);
0

There are 0 best solutions below