Вопрос по Selenium Server с запуском различных браузеров

Всем привет у меня вопрос :slight_smile: стандартно на FF запускается, при попытке запустить , к примеру, в хроме , появляетс я ошибка ,
пример кода :smile:

////////////////////////////////////////

package Remote;

import com.thoughtworks.selenium.DefaultSelenium;
import com.thoughtworks.selenium.Selenium;
import org.junit.*;
import org.openqa.selenium.Platform;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.FirefoxProfile;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;
import java.net.URL;
import static com.thoughtworks.selenium.SeleneseTestBase.assertEquals;

public class Remote
{
private Selenium selenium;

@Before
public void setUp() throws Exception {
    selenium = new DefaultSelenium("localhost", 4444, "*chrome C:\\chromedriver\\chrome.exe", "http://www..com/");
    selenium.start();
}

@Test
public void testSelenium() throws Exception {
    selenium.open("/");
    selenium.click("css=span.arrow");
    selenium.click("link=Sign in");
    selenium.click("id=usernameInput");
    selenium.type("id=usernameInput", "");
    selenium.type("id=passInput", "");
    selenium.click("//input[@value='enter']");
    selenium.waitForPageToLoad("30000");
    selenium.click("//input[@value='Sign in']");
    selenium.click("css=div.cell.input-block > label.input-block-hint");
    selenium.type("id=titlebarUsernameInput", "");
    selenium.type("id=titlebarPassInput", "");
    selenium.click("//input[@value='Submit']");
    selenium.waitForPageToLoad("30000");
    assertEquals("loyalty program", selenium.getText("css=h1.strong-title"));
    selenium.click("css=img[alt=\"\"]");
    selenium.waitForPageToLoad("30000");
    selenium.click("link=Ireland");
}

@After
public void tearDown() throws Exception {
    selenium.stop();
}

}

если вместо selenium = new DefaultSelenium(“localhost”, 4444, “*chrome C:\chromedriver\chrome.exe”, “http://www…com/”);
вписать selenium = new DefaultSelenium(“localhost”, 4444, “*firefox”, “http://www…com/”);
то всё отлично работает

может кто-то подсказать, как можно правильно выполнить этот тест?

и вопрос №2

можно ли вместо selenium.xxxx использовать ООП , чтобы вызывать классы и методы?
К примеру :

    HPage 1= new HPage(driver);
    Expected hotel = 1.Select_Bloomsbury("Homepage selecting");
    Expected calendar = 1.Select_Calendar("Click on calendar");
    driver.manage().timeouts().implicitlyWait(3, TimeUnit.SECONDS);
    Expected dates = 1.Select_Dates("Select Dates");
    driver.manage().timeouts().implicitlyWait(3, TimeUnit.SECONDS);
    Expected submit = 1.Click_Search("Submit");
    Assert.assertTrue(submit.getName().contains("SELECT 1& 2"));

нужно скачать драйвер https://code.google.com/p/selenium/wiki/ChromeDriver

так драйвер есть, и я прописал к нему адресс
C:\chromedriver\chrome.exe

запускаешь селениум с параметром -Dwebdriver.chrome.driver=%path%\chromedriver.exe ?

нет , запускаю через Intellij Idea

запустите селениум с параметрами java -jar %path%\selenium-server-standalone.jar -Dwebdriver.chrome.driver=%path%\chromedriver.exe -Dwebdriver.ie.driver=%path%\IEDriverServer.exe , отдельно батником, или к параметрам запуска “before launch” в run/debug configuration

Спасибо, вписал…теперь очень долго обрабатывает в cmd пишется, что подготавливает FifreFox profile…хотя чего, не понятно…

@Before
public void setUp() throws Exception {
String hubURL = “http://127.0.0.1:4444/wd/hub”;
DesiredCapabilities capability = DesiredCapabilities.chrome();
capability.setBrowserName(“google chrome”);
capability.setPlatform(Platform.valueOf(“WINDOWS”));
capability.setVersion(“31.0.1650.63 m”);
// WebDriver driver = new RemoteWebDriver(new URL(hubURL), capability);
selenium = new DefaultSelenium(“localhost”, 4444, “*googlechrome C:\chromedriver\chrome.exe”, “http://www.doylecollection.com/”);
selenium.start();
}

INFO - Launching Google Chrome…

и на этом всё