List of usage examples for org.openqa.selenium.firefox FirefoxDriver FirefoxDriver
public FirefoxDriver()
From source file:net.mindengine.galen.tests.selenium.GalenSeleniumTest.java
License:Apache License
@BeforeMethod public void createDriver() { driver = new FirefoxDriver(); }
From source file:net.modelbased.sensapp.acceptance.SensAppTest.java
License:Open Source License
public SensAppTest() throws IOException, MissingEndPointException { final EndPoints endPoints = EndPointsBroker.getInstance().getEndPoints(); sensapp = new SensApp(new SensAppAdminWithSelenium(endPoints, new FirefoxDriver()), new RestDispatcher(endPoints), new RestStorage(endPoints)); this.samples = new SampleFactory(sensapp); }
From source file:net.osgiliath.messaging.repository.impl.itests.ITHelloWebUITest.java
License:Apache License
@Test public void testSayHello() throws Exception { final WebDriver driver; driver = new FirefoxDriver(); // Sleep until the elements we want is visible or 5 seconds is over long end = System.currentTimeMillis() + 10000; (new WebDriverWait(driver, 300)).until(new ExpectedCondition<Boolean>() { public Boolean apply(WebDriver d) { driver.get("http://localhost:8181/net.osgiliath.hello.ui"); boolean ret = d.getTitle().toLowerCase().startsWith("hello"); if (!ret) { driver.navigate().refresh(); }//from ww w . j av a2s . c o m return ret; } }); WebElement element; element = driver.findElement(By.id("helloInput")); element.click(); element.sendKeys(CORRECT_NAME); element = driver.findElement(By.id("helloButton")); element.click(); (new WebDriverWait(driver, 20)).until(new ExpectedCondition<Boolean>() { public Boolean apply(WebDriver d) { Collection<WebElement> cells = d.findElements(By.xpath("//table//tr//td")); return cells.size() == 1; } }); end = System.currentTimeMillis() + 10000; driver.close(); }
From source file:newMember.newTrial.java
License:Open Source License
public static void main(String[] args) throws IOException { //setProperty(a,b): Ensure b is set to path of gecko driver //ClassLoader loader = ClassLoader.getSystemClassLoader(); //URL path = loader.getResource("geckodriver.exe"); ClassLoader cl = Thread.currentThread().getContextClassLoader(); URL url = cl.getResource("geckodriver/geckodriver/geckodriver.exe"); System.setProperty("webdriver.chrome.driver", url.getPath()); //System.setProperty("webdriver.gecko.driver", "C:/Users/Sherlock Mind Palace/workspace/TrialRun/geckodriver/geckodriver.exe"); WebDriver driver = new FirefoxDriver(); DesiredCapabilities capabilities = DesiredCapabilities.firefox(); capabilities.setCapability("marionette", true); //Go to testing site driver.get("https://apptimize.com"); //Click on Sign Up button driver.findElement(By.xpath("//a[@href='/30-day-trial']")).click(); //Search for id fname for 10 seconds before giving up WebElement fname = (new WebDriverWait(driver, 10)) .until(ExpectedConditions.presenceOfElementLocated(By.id("fname"))); fname.sendKeys(member.fName);// w ww. ja v a 2 s .c o m WebElement lname = driver.findElement(By.id("lname")); lname.sendKeys(member.lName); //Fill in email field WebElement email = driver.findElement(By.id("email")); email.sendKeys(member.eMail); //Fill in Company name WebElement cname = driver.findElement(By.id("company")); cname.sendKeys("Apptimize Candidate"); //Fill in Phone and Job field WebElement phone = driver.findElement(By.id("phone")); phone.sendKeys(member.pNumber); WebElement jtitle = driver.findElement(By.id("jobtitle")); jtitle.sendKeys(member.jTitle); //Create password WebElement password = driver.findElement(By.id("password")); password.sendKeys(member.pWord); //Select No to software radio question WebElement rNo = driver.findElement(By.xpath("//input[@name='purchased' and @value='No']")); rNo.click(); //Select End User License Agreement Checkbox WebElement read = driver.findElement(By.id("eula")); read.click(); //WebElement submit = driver.findElement(By.id("submit")); //submit.click(); System.out.println("You successfully signed up for trial account."); driver.quit(); }
From source file:ngpanwei.bdd.setup.BacklogUIBasedCleaner.java
License:Open Source License
@Before public void setUp() throws Exception { driver = new FirefoxDriver(); baseUrl = "http://localhost:8080"; driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS); }
From source file:ngpanwei.bdd.stepdefs.BacklogStepDefs.java
License:Open Source License
@Before public void setUp() throws Exception { driver = new FirefoxDriver(); baseUrl = "http://localhost:8080/"; driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS); driver.get(baseUrl + "task"); }
From source file:ngpanwei.tests.functional.login.LoginUISteps.java
License:Open Source License
@Before public void beforeScenario() { driver = new FirefoxDriver(); baseUrl = "http://localhost:8080"; driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS); }
From source file:nl.surfnet.coin.selenium.SeleniumSupport.java
License:Apache License
private void initFirefoxDriver() { driver = new FirefoxDriver(); driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS); Runtime.getRuntime().addShutdownHook(new Thread() { @Override/* w w w . java2s . c o m*/ public void run() { if (driver != null) { driver.quit(); } } }); }
From source file:okw.gui.adapter.selenium.SeDriver.java
License:Open Source License
public void DriveFireFox() { this.driver = new FirefoxDriver(); }
From source file:okw.gui.adapter.selenium.webdriver.SeFirefoxApp.java
License:Open Source License
public void StartApp() { MyLogger.LogFunctionStartDebug("StartApp"); SeDriver.getInstance().driver = new FirefoxDriver(); this.Init();//from www . ja v a 2 s . c o m MyLogger.LogFunctionEndDebug(); }