Я пытаюсь запустить простой тест, чтобы увидеть, могу ли я работать с нижеприведенными возможностями.
OS: Windows 7
Browser: Firefox
Browser Version: 33
Вот мой код:
import static org.junit.Assert.*;
import java.net.URL;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;
public class Tests {
private WebDriver driver;
@Before
public void setUp() throws Exception {
// Choose the browser, version, and platform to test
DesiredCapabilities caps = DesiredCapabilities.firefox();
caps.setCapability("platform", "Windows 7");
caps.setCapability("version", "33");
caps.setCapability("browserName", "");
// Create the connection to Sauce Labs to run the tests
this.driver = new RemoteWebDriver(
new URL("http://<axxxxxx>:<[email protected]:80/wd/hub"),
caps);
}
@Test
public void webDriver() throws Exception {
// Make the browser get the page and check its title
driver.get("http://www.amazon.com/");
assertEquals("Amazon.com: Online Shopping for Electronics, Apparel, Computers, Books, DVDs & more", driver.getTitle());
}
@After
public void tearDown() throws Exception {
driver.quit();
}
}
Когда я запускаю этот тест, похоже, я не могу использовать Windows 7:
java.lang.IllegalArgumentException: No enum constant org.openqa.selenium.Platform.Windows 7
at java.lang.Enum.valueOf(Enum.java:236)
at org.openqa.selenium.Platform.valueOf(Platform.java:30)
at org.openqa.selenium.remote.DesiredCapabilities.setCapability(DesiredCapabilities.java:168)
Я сбит с толку. На веб-сайте http://docs.seleniumhq.org/about/platforms.jsp указано, что Windows 7 поддерживается. Где я делаю ошибку?
Platform.WINDOWS
в setCapability? - person Vivek Singh   schedule 08.01.2015