간단한 테스트를 실행하여 아래 기능을 사용할 수 있는지 확인하려고합니다.saelcelabs에서 셀렌 테스트 실행 Windows7
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)
내가 혼란 스러워요 :이 테스트를 실행하면 내가 윈도우 7을 사용할 수 없습니다처럼
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();
}
}
, 그것은 같습니다
OS: Windows 7
Browser: Firefox
Browser Version: 33
여기 내 코드입니다. 웹 사이트 http://docs.seleniumhq.org/about/platforms.jsp은 Windows 7이 지원된다고 말합니다. 내가 실수 한 부분이 어디 있니?
setCapability에서'Platform.WINDOWS'로 시도해 볼 수 있습니까? –
어떤 셀렌 버전을 사용하고 있습니까? Sauce Labs에서 지원하는 최신 버전 인 2.43.0을 사용하는 경우 작동합니까? – Louis
VISTA로 플랫폼을 말할 필요가있는 것 같습니다. Windows7에서 실행 중입니다 .DesiredCapabilities capabilities = DesiredCapabilities.firefox(); capabilities.setCapability ("version", "33"); capabilities.setCapability ("platform", Platform.VISTA); capabilities.setCapability ("name", "Windows7Firefox33"); –