/ Published in: Java
URL: http://www.meetup.com/agiletesting
Download libs here - http://selenium.googlecode.com/files/webdriver-all-7376.zip
Expand |
Embed | Plain Text
package uk.co.nathanbain.WebTestingFixtures; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.ie.InternetExplorerDriver; import fitlibrary.*; public class WebTestingFixtures extends DoFixture { public static WebDriver driver; public void openBrowser() { driver = new InternetExplorerDriver(); } public void closeBrowser() { driver.close(); } { driver.get(url); } { WebElement element = driver.findElement(By.name(txtName)); element.sendKeys(text); element.submit(); } { if(driver.getPageSource().contains(text)) { return true; } return false; } } --------------------------- !path lib\fitlibrary.jar !path fitnesse.jar !path lib\WebDriver\*.jar !define TEST_SYSTEM {fit} !path C:\fitnesse\bin !|uk.co.nathanbain.WebTestingFixtures.WebTestingFixtures| |open browser| |go to|http://www.google.com| |type|cheese|into the textbox with name|q|and submit| |confirm the page contains the words|www.cheese.com| |close browser|
You need to login to post a comment.
