Created
April 8, 2015 11:44
-
-
Save ptcmariano/b13da23127593fb51287 to your computer and use it in GitHub Desktop.
EmulationMobileChrome.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//http://testeimporta.blogspot.com.br/2015/04/referencia-de-emulacao-do-chrome-no.html | |
//imports | |
import org.openqa.selenium.WebDriver; | |
import org.openqa.selenium.chrome.ChromeDriver; | |
import org.openqa.selenium.chrome.ChromeOptions; | |
import org.openqa.selenium.remote.DesiredCapabilities; | |
import javax.swing.*; | |
import java.util.HashMap; | |
import java.util.Map; | |
//metodo de teste | |
@Test | |
public void testEmulation(){ | |
Map<String, String> mobileEmulation = new HashMap<String, String>(); | |
mobileEmulation.put("deviceName", "Samsung Galaxy Tab"); | |
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.navigate().to("http://www.google.com.br/"); | |
JOptionPane.showMessageDialog(null, "emule"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment