You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In order to help us efficiently investigate your issue, please provide the following information:
Platform and application details
Platform:
Firefox:
Selenium: <3.3.1>
I have written the code below to open firefox in responsive mode . . The firefox opens in mobile mode but with default size and not the size mentioned in code.
You are trying to use features which are only available in chrome scope of Firefox. While staying in content (which is the default) you won't be able to open the responsive design mode of Firefox. So switch the context to chrome first, and then try again. Whereby you will have to check if your Selenium binding is supporting that already or not. For the Python binding it would be driver.set_context("chrome").
I'm keeping this issue closed given the above clarification.
This issue has been automatically locked since there has not been any recent activity after it was closed. If you have run into an issue you think is related, please open a new issue.
lockbot
locked and limited conversation to collaborators
Aug 17, 2019
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
In order to help us efficiently investigate your issue, please provide the following information:
Platform and application details
I have written the code below to open firefox in responsive mode . . The firefox opens in mobile mode but with default size and not the size mentioned in code.
Please check and let me know the issue
public class FirefoxResponsiveMode {
public static void pressShortcut(WebDriver driver) throws AWTException {
Robot robot = new Robot();
robot.keyPress(KeyEvent.VK_SHIFT);
robot.keyPress(KeyEvent.VK_CONTROL);
robot.keyPress(KeyEvent.VK_M);
robot.keyRelease(KeyEvent.VK_SHIFT);
robot.keyRelease(KeyEvent.VK_CONTROL);
robot.keyRelease(KeyEvent.VK_M);
//WebElement e= driver.findElement(By.xpath("html/body"));
//e.sendKeys(Keys.chord(Keys.CONTROL,Keys.SHIFT));
// Actions actions = new Actions(driver);
// actions.keyDown(Keys.CONTROL).keyDown(Keys.SHIFT).sendKeys("m").keyUp(Keys.SHIFT).keyUp(Keys.CONTROL).perform();
}
public static void setViewSize(FirefoxProfile profile, String viewDeviceName, Integer width, Integer height) throws InterruptedException {
Thread.sleep(3000);
// String responsiveMode = "[{"width": " + width + ", "name": "" + viewDeviceName + "", "key": "" + width + "x" + height + "", "height": "
// + height + "}]";
String responsiveMode =
"[{"width": " + width + ", "name": "" + viewDeviceName + "", "key": "" + width + "x" + height + "", "height": "
+ height + "}]";
profile.setPreference("devtools.responsiveUI.presets", responsiveMode);
Thread.sleep(3000);
}
}
package test;
import java.awt.AWTException;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.FirefoxProfile;
import org.openqa.selenium.remote.DesiredCapabilities;
public class MT {
The text was updated successfully, but these errors were encountered: