
| Current Path : /var/www/web-klick.de/dsh/90_akt/selenium/selenium_grid/src/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : /var/www/web-klick.de/dsh/90_akt/selenium/selenium_grid/src/GridWebdriver2.java |
import java.net.MalformedURLException;
import java.net.URL;
import org.openqa.selenium.*;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;
public class GridWebdriver2
{
public WebDriver driver;
public String url = "http://localhost:4444/wd/hub";
public String google = "http://google.com";
public String firefox = "firefox";
public void setup2() throws MalformedURLException
{
DesiredCapabilities capability = DesiredCapabilities.firefox();
capability.setBrowserName(firefox);
capability.setPlatform(org.openqa.selenium.Platform.ANY);
capability.setVersion("");
driver = new RemoteWebDriver(new URL(url), capability);
driver.navigate().to(google);
}
public void test_d()
{
WebElement editbox = driver.findElement(By.name("q"));
WebElement button = driver.findElement(By.name("btnG"));
editbox.clear();
editbox.sendKeys("This is test number four !");
button.click();
}
public void test_e()
{
WebElement editbox = driver.findElement(By.name("q"));
WebElement button = driver.findElement(By.name("btnG"));
editbox.clear();
editbox.sendKeys("This is test number five !");
button.click();
}
public void test_f()
{
WebElement editbox = driver.findElement(By.name("q"));
WebElement button = driver.findElement(By.name("btnG"));
editbox.clear();
editbox.sendKeys("This is test number six !");
button.click();
}
public void finish2()
{
driver.quit();
}
}