This blog comprises of learning to get started with Open source automation tools. Mentions best practices of Agile,Xtreme Programming Selenium In nutshell.
Favourite Quote
Thursday, March 1, 2012
Writing our first script in WebDriver
Prior to getting started with writing scripts ensure that you have completed your installations & you have identified which framework you would work with
I have chosen to write the test in JUnit Framework , Where Eclipse is my IDE & Selenium 2.
Here is a basic script for search on an amazon site.
Objects that are dealt are :
1. Drop down list
2. Text box
3. Button
4. Link
Actions performed are :
1. Am selecting a value from drop down list
2. Enetering text in the text box
3. Clicking on the button.
4. Clicking the link that meets my partial text of the url's fetched
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
public class Search {
@Test
public void testSearch(){
WebDriver driver = new FirefoxDriver();
driver.navigate().to("http://www.amazon.co.uk/");
WebElement dropDownsearch = driver.findElement(By.id("searchDropdownBox"));
dropDownsearch.sendKeys("Electronics & Photo");
driver.findElement(By.id("twotabsearchtextbox")).clear();
driver.findElement(By.id("twotabsearchtextbox")).sendKeys("Sat Nav & Car Electronics");
driver.findElement(By.id("navGoButton")).click();
driver.findElement(By.partialLinkText("Satellite Navigation System")).click();
driver.close();
}
}
Subscribe to:
Post Comments (Atom)
Hi Shabana, i need some info abt Jmeter, right now iam working as QA Automation in C london,
ReplyDeleteplease provide info to contact..
mails2chandra.v@gmail.com
Hey There,
DeleteMy Blog has most of the information you are seeking on Jmeter.
Any specifics please ask