Showing posts with label Selenium. Show all posts
Showing posts with label Selenium. Show all posts

Wednesday, 22 January 2014

Copying the One Excel sheet to another excel sheet and Update test cases staus using Java and JXL

import java.io.File;

import jxl.Workbook;
import jxl.format.Border;
import jxl.format.BorderLineStyle;
import jxl.format.Colour;
import jxl.write.Label;
import jxl.write.WritableCellFormat;
import jxl.write.WritableSheet;
import jxl.write.WritableWorkbook;

import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;


public class SampleExcelStatus
{
      @BeforeTest
      public void setup() throws Exception
     
      {
           
      }

      @Test
      public static  void SecondExcelFile() throws Exception
      {   
        Workbook workbook = Workbook.getWorkbook(new File("E:/6409_TestCases_Checkout.xls"));
        WritableWorkbook copywb = Workbook.createWorkbook(new File("E:/6409_TestCases_CheckoutResultsSatya.xls"), workbook);
        WritableSheet sheet1=copywb.getSheet(0);
       
        for(int URowcount=12; URowcount<sheet1.getRows();URowcount++)
            {
                   Label label = new Label(10,URowcount-1,"Pass");
                   WritableCellFormat cfobj=new WritableCellFormat();
                    /*cfobj.setBackground(Colour.GREY_25_PERCENT);
                    cfobj.setAlignment(Alignment.LEFT);
                    cfobj.setOrientation(Orientation.HORIZONTAL);*/
                    cfobj.setBorder(Border.ALL, BorderLineStyle.THIN,Colour.BLACK);
                    label.setCellFormat(cfobj);
                   
                    sheet1.addCell(label);
            }
       
        copywb.write();
        copywb.close();
        workbook.close();
       
      }
     
            @AfterClass
            public void tearDown()
            {
            //    driver.close();
            }  
}

Thursday, 19 September 2013

Selenium WebDriver Interface

The interface WebDriver represents the main interface for testing a web browser instance. If you are using Selenium 2 then it is highly recommended to use the WebDriver instance because of the benefits suggested in my previous posts.
This interface provides most of the basic requirements for testing a web application. Normally the testing of a web application requires either one or all of the following three functions:

  • Controling The browser
  • Selecting the WebElement
  • Debugging aids
The methods in this class provide solutions to the requirements in all the three categories mentioned above:
· Control of the browser:
    • get(): Loads the web page rendered by the URL string passed to this method. Similar results can be obtained by using WebDriver.Navigation.to(String)
    • navigate():Loads the web page rendered by the URL and access browser history
    • close(): Closes the ‘Current’ browser window
    • quite(): Closes ‘All’ browser windows associated with the webDriver instance
    • switchTo(): Changes current window and redirects all commands to the new ‘current’ window (example: switchTo().window(String))
    • manage(): Enables access to browser menu items, such as add cookies, logs etc 
        
· Selection of WebElement:
    • findElement(): Returns the first ‘Webelement’ found
    • findElements(): Returns all the ‘WebElements’ found in the current web page
· Debugging aids:
    • getCurrentUrl(): Returns the current URL loaded in the browser session
    • getPageSource(): Returns HTML source of the current page loaded in the browser
    • getTitle(): Returns the title of current page
    • getWindowHandle(): Return unique string identifier of the current window in the driver instance
    • getWindowHandles(): Return identifiers of all the windows in the driver instance

Comparative analysis of the WebDrivers’ Drivers

While working with selenium webdriver you have an option to choose from multiple webdrivers, such as HtmlUnitDriver, FirefoxDriver, InternetExplorerDriver, ChromeDriver and OperaDriver. Each one of them is a separate implementation of the WebDriver interface provided by Selenium. All of them have unique advantages and disadvantages because of the implementation differences for catering to different requirements. It is good to know the comparative advantages and disadvantages of each one before picking one of them.
The first major point to note is that there are two groups of driver implementations. One of those that invoke the actual browser installed on your system and the other that emulates the behavior of another browser. FirefoxDriver, InternetExplorerDriver, ChromeDriver and OperaDriver invoke the actual browser installed on the machine; however the HtmlUnitDriver emulates other browsers JS behavior. 

HtmlUnitDriver

 HtmlUnit is a java based framework for testing webApps basically a wrapper around ‘HttpClient’ by Jakarta. HtmlUnit provides UI-Less emulation of browsers to test web applications. The HtmlUnit APIs let you do the typical functions performed in an actual web browser, such as click links, fill forms, invoke web pages, submit values etc. HtmlUnit supports java script and complex AJAX libraries. Javascript is disabled in the HtmlUnitDriver by default, however if it can be enabled if required. The mechanism to enable javascript with the HtmlUnitDriver is as follows:

HtmlUnitDriver MyhtmlDriver = new HtmlUnitDriver();
 MyhtmlDriver.setJavascriptEnabled(true);
OR
HtmlUnitDriver MyhtmlDriver = new HtmlUnitDriver(true);

When enabled, the HtmlUnitDriver emulates the java script behavior of Internet Explorer by default. However we can direct the HtmlUnitDriver to emulate the JavaScript behavior of the browser of our choice by invoking the constructor that accepts the browser version. This can be done as follows:
HtmlUnitDriver MyhtmlDriver = new HtmlUnitDriver(BrowserVersion.Firefox_2);

Internet Explorer Driver

 The IE driver class ‘InternetExplorerDriver.class’ is located at ‘\org\openqa\selenium\ie\’ directory in the ‘selenium-server-standalone-2.7.0.jar’. To use the InternetExplorerDriver all you need to do is to have the selenium-server-standalone-2.7.0.jar in your CLASSPATH.  The IE driver runs only on windows and supports both 32-bit and 64-bit operations. Depending on the thread that instantiates the InternetExplorerDriver corresponding version of the IE is launched i.e. if the thread instantiating driver is running in 32-bit then the 32-bit version of the IE will be launched and if the thread instantiating driver is running in 64-bit then the 64-bit version of the IE will be launched.

The Internet Explorer driver uses the native or OS-level events to perform various functions on the browser, such as inputs from keyboard and mouse. This approach has both advantages and limitations both. The advantages are that it bypasses the limitations of the Javascript sandbox but there can be issues like the browser window under test might be out of focus.

Firefox Driver

selenium-server-standalone-X.X.X.jar’ contains all the drivers implementing the WebDriver interface of selenium. Hence the 'FirefoxDriver.class' can be found in the ‘\org\openqa\selenium\firefox directory in the selenium-server-standalone-X.X.X.jar. The driver when instantiated is added as an extension to the firefox profile. You can specify the profile with which you want to load firefox session. If no profile is specified then the driver creates an anonymous profile by default.
A profile can be created for the firefox driver as follows:

FirefoxProfile myProfile = new FirefoxProfile();

Multiple operations can be performed on the newly created profile, such as:

myProfile.addExtension(File);
myProfile.clean();
myProfile.getPort();
myProfile.setPort(int port);
myProfile.enableNativeEvents();
myProfile.setPreference(String key, String value); etc...

After creating the your profile you can pass the profile while creating the driver instance as follows:
WebDriver myFireFoxDriver = new FirefoxDriver(myProfile);

This driver is faster than the InternetExplorerDriver and executes the test in real Firefox web browser.

Wednesday, 4 September 2013

SeleniumQuestions..


  1. Which of these WebDriver interface methods is used to open a URL in the browser?
    A)get
    b)navigate().to
    c)Any of the above
    d)None of the above
    ans c
  2. What is the difference between WebDriver close and quit methods?
    a)Nothing, these methods are interchangeable.
    b)close method clears the browser memory and the quit method closes the browser window.
    c)close method closes the browser but the quit method additionally removes the connection to the server.
    d)close method closes the main browser window but the quit method closes all the browser windows including popups.
    Ans :d


  1. When invoked on a web element, what does the submit method do?
a)It is used to submit a form and it works on any web element.
b)It is used to submit a form but it works only on the web element whose type is "submit".
c)It is the same as the click method.
d)There is no submit method for a web element.
Ans:a
4. Which WebDriver method is used to change focus to an alert, a web element or a browser window?
a)changeFocus
b)switchTo
c)goTo
d)setFocus
Ans:b
5 . What functionality does WebDriver support on browser cookies?
a)add and delete an individual cookie
b)delete all cookies
c)any of the above
d)none of the above
ans:c
6. What is the scope of an implicit wait?
a)All instances of WebDriver
b)Current WebDriver instance
c)Current expected condition
d)Current web element
ans:b
7. What kind of application is the Selenium IDE?
a)Windows application
b)Web application
c)Firefox add-on
d)None of these
ans:c

8. A Selenium IDE test case has three columns, Command, Target and Value. What data is stored in the Target column?
a)Element or location where the command is executed
b)Test step execution result
c)[Optional] purpose of the test step
d)None of these
ans: a
9. By default, in which format does the Selenium IDE save a test case?
a)In proprietary format
b)As HTML
c)As Java source code
d)As Ruby or Python or C# code depending on user options selected during installation
ans:b
9. What features are available in Selenium IDE to debug an automated test case?
a)Toggle Breakpoint
b)Pause/ Resume
c)Step
d)All of these
ans:d
10. What is the Selenium print command?
a)echo
b)print
c)alert
d)System.out.println()
ans: a
11. What is the difference between a command and the same command with "AndWait" (e.g. click and clickAndWait commands)?
a)Selenium waits indefinitely for the result of the "AndWait" command.
b)It waits for the result of the "AndWait" command but only for 30 seconds (default timeout).
c)It waits for the result of the "AndWait" command but only up to a maximum of 30 seconds (default timeout).
d)Some commands do not have an "AndWait" command, so this question is incorrect.
Ans: c
12. What is the correct syntax to access the value of a Selenium variable called name?
a)name
b)$name
c){name}
d)${name}
ans:d
13. What is the difference between assert and verify commands?
a)Assert commands are more uncommon than verify commands.
b)Typically, an assert command is followed by verify command(s).
c)A failed assert command stops the test but a failed verify command does not do so.
d)All of the above
ans: d
14. In which associative array does Selenium store all of a test case's variables and their respective values?
a)Array
b)storedVars
c)var
d)There is no such array in Selenium.
Ans b

15. Where can you create your own Selenium commands?
a)This is not possible.
b)In user-extensions.js file
c)In any JavaScript file, but the preferred name is user-extensions.js for consistency
d)In any Java, C#, Python, Ruby, PHP or Perl file
ans:c
16. What URLs does the Selenium open command allow?
a)Only the base URL
b)Any URL relative to the base URL
c)Any absolute URL
d)Any of the above
ans: d
17. What is the purpose of the Find button?
a)Highlight the element that is given in the locator
b)Search the appropriate command for the given target
c)Find the current value of the target
d)None of the above
ans:a
18. Which one of the following statements is incorrect?
a)Breakpoint and Start point cannot both exist on the same command.
b)The shortcut key for Breakpoint is B and for Start point is S.
c)A Breakpoint or a Start point cannot be put on a comment line.
d)Both Breakpoint and Start point are used in debugging the test case.
Ans:c

19. Which add-on is commonly used with Selenium IDE to identify individual elements on a web page?
a)FirePath
b)Firebug
c)XPath
d)No add-on is required. You can view the Page Source and locate any element within the HTML code easily.
Ans b(Firebug is the required add-on. FirePath is only a Firebug extension that shows XPath.)

20. Why are relative XPaths preferred over absolute XPaths as locators?
a)For non-root elements, absolute XPaths are longer and slow down the test automation.
b)Absolute XPaths fail if any part of the path changes even slightly.
c)Relative XPaths are the default in Selenium.
d)None of the above
ans: b

21. Which of the following is an incorrect target for pattern matching as in verifyTextPresent command?
a)glob:Customer*Subscriber
b)You entered the character, ?
c)regexp:[JFM]
d)exact:* Summary
ans:D(The exact pattern does not use any special character for patterns.)

22. What is the best way to handle asynchronous data retrieval from the server as in AJAX applications?
a)Run the test case at the slowest speed.
b)Use the pause command.
c)Use the "AndWait" commands.
d)Use the "waitFor" commands.
Ans:d

23. What happens when the application creates a JavaScript alert during test case play?
a)The alert is suppressed by Selenium..
b)If there is no command to handle the alert, the play is stopped with an error.
c)If the alert is handled with assertAlert, assertAlertPresent or verifyAlert, no alert is displayed and there is no error.
d)Each of the above
ans :D

24. What is data parameterization?
a)Using variable test data in place of fixed test data values
b)Using different number of test data values when executing the same test case
c)Putting pre-requisites for the test case to execute
d)Limiting the test case execution only when certain conditions exist
ans:a

25. Which of the following statements is correct for a Test Suite?
a)A Test Suite is a comma separated values file.
b)A Test Suite is an HTML file containing a table with a single column.
c)The test cases of a Test Suite must be placed in the same folder as the Test Suite.
d)A new Test Suite can have only new test cases.
Ans:b
26. What are the different modes that Selenium uses?
a)*iehta
b)*firefox and *iexplore
c)*chrome
d)All of the above
ans:d
27. How do you start the browser?
a)selenium.Start()
b)get start()
c)selenium.server start()
d)None of the above
ans :a
28. Do you need to have Selenium .jar files as a dependency of your tests?
a)Yes
b)No
c)Yes, but as a good practice only
d)No Selenium jar file is provided with Selenium RC.
Ans:a
29. How many parameters does the Selenium object take when using DefaultSelenium?
a)2
b)3
c)4
d)6
ans:c
30. How do you start selenium rc server with user extensions?
a)java -jar selenium-server.jar
b)java -jar selenium-server.jar -userExtensions user-extensions.js
c)java -jar selenium-server.jar user-extensions.js
d)java -jar selenium-server.jar user-extensions.js -h
ans:B

31. Which Selenium command do you use to run commands in slow motion in Selenium RC?
a)selenium.setSpeed()
b)selenium.speed()
c)selenium.serverSpeed()
d)None of the above
ans:a
32. Which command is used to get the alert box?
a)assertequals(selenium.getAlert())
b)selenium.getAlert()
c)selenium.alertBox()
d)selenium.click()
ans:b
33. Which command is used for verifying if a web element exists?
a)selenium.isElementPresent(String locator)
b)assertTrue(Selenium.isElementPresent())
c)selenium.ElementPresent()
d)None of the above
ans:a
34. Which command is used for typing in a textbox?
a)selenium.input()
b)selenium.type(String locator, String value)
c)assertequals(selenium.getValues())
d)selenium.textInput()
ans:b
35. What is the command to load a page?
a)selenium.waitForPageToLoad(String timeoutInMilliseconds)
d)selenium.waitForPageToLoadInt timeoutInMilliseconds
c)selenium.waitForPageToLoad(timeoutInMilliseconds)
d)selenium.waitForPageToLoad()
ans a



Tuesday, 30 July 2013

Webdriver - Page Object Pattern


Page Object Pattern, the term that selenium users keep buzzing. Page object is a design pattern that can be implemented as a selenium best practices. The functionality classes (PageObjects) in this design represent a logical relationship between the pages of the application.
  • The Page Object pattern represents the screens of your web app as a series of objects and encapsulates the features represented by a page.
  • It allows us to model the UI in our tests.
  • A page object is an object-oriented class that serves as an interface to a page of your AUT.
More on Page Object Pattern at Selenium wiki. Some of the advantages of page object pattern as listed below,
  • Reduces the duplication of code
  •  Makes tests more readable and robust
  • Improves the maintainability of tests, particularly when there is frequent change in the AUT. (Useful in Agile methodology based projects)
Enough of theory, lets get into practical implementation.
let's take one scenario and see how we can automate it without and with Page Object Pattern Scenario:
  1. Open http://newtours.demoaut.com/ site 
  2. Login to the site. 
  3. Log out. Now if we are not using any design patten the testcase will look like below 
01.@Test
02.public void testLogin() {
03.driver.findElement(By.id("userName")).clear();
04.driver.findElement(By.id("userName")).sendKeys("testuser33");
05. 
06.driver.findElement(By.id("password")).clear();
07.driver.findElement(By.id("password")).sendKeys("password123");
08. 
09.driver.findElement(By.id("login")).click();
10. 
11.driver.findElement(By.linkText("SIGN-OFF")).click();
12. 
13.}
Now let's see how the code will look like if we will have to use the Page Object Pattern with Page Factory. LoginPage.java - contains Login page web elements and functions

01.package Pages;
02. 
03.import org.openqa.selenium.WebDriver;
04.import org.openqa.selenium.WebElement;
05.import org.openqa.selenium.support.FindBy;
06.import org.openqa.selenium.support.How;
07.import org.openqa.selenium.support.PageFactory;
08. 
09.public class LoginPage {
10. 
11.final WebDriver driver;
12. 
13.@FindBy(how = How.NAME, using = "userName")
14.private WebElement usernameEditbox;
15. 
16.@FindBy(how = How.NAME, using = "password")
17.private WebElement passwordEditbox;
18. 
19.@FindBy(how = How.NAME, using = "login")
20.private WebElement singinButton;
21. 
22.public LoginPage(WebDriver driver) {
23.this.driver = driver;
24.}
25. 
26.public void enterUsername(String login) {
27.usernameEditbox.clear();
28.usernameEditbox.sendKeys(login);
29.}
30. 
31.public void enterPassword(String password) {
32.passwordEditbox.clear();
33.passwordEditbox.sendKeys(password);
34.}
35. 
36.public void clickSigninButton() {
37.singinButton.click();
38.}
39. 
40.public FindFlightPage login(String login, String password) {
41.enterUsername(login);
42.enterPassword(password);
43.clickSigninButton();
44.return PageFactory.initElements(driver, FindFlightPage.class);
45.}
46.}
FindFlightPage.java - contains Find Flight page web elements and functions  


01.package Pages;
02. 
03.import org.openqa.selenium.WebDriver;
04.import org.openqa.selenium.WebElement;
05.import org.openqa.selenium.support.FindBy;
06.import org.openqa.selenium.support.How;
07.import org.openqa.selenium.support.PageFactory;
08. 
09.public class FindFlightPage {
10. 
11.final WebDriver driver;
12. 
13.public FindFlightPage(WebDriver driver) {
14.this.driver = driver;
15.}
16. 
17.@FindBy(how = How.LINK_TEXT, using="SIGN-OFF")
18.private WebElement signOff;
19. 
20.public LoginPage singOff(){
21.signOff.click(); 
22.return PageFactory.initElements(driver, LoginPage.class);
23.}
24.}
LoginTest.java  - Actual class which contains tests for login page 

01.package Tests;
02. 
03.import org.openqa.selenium.WebDriver;
04.import org.openqa.selenium.firefox.FirefoxDriver;
05.import org.openqa.selenium.support.PageFactory;
06.import org.testng.annotations.AfterClass;
07.import org.testng.annotations.BeforeClass;
08.import org.testng.annotations.Test;
09. 
10.import Pages.FindFlightPage;
11.import Pages.LoginPage;
12. 
13.public class LoginTest {
14. 
15.WebDriver driver;
16.private static String login = "testuser33";
17.private static String pass = "password123";
18. 
19.@BeforeClass
20.public void setUp() throws Exception {
21.driver = new FirefoxDriver();
23.}
24. 
25.@Test
26.public void testLogin() {
27. 
28.LoginPage loginPage = PageFactory.initElements(driver, LoginPage.class);
29.FindFlightPage findPage = loginPage.login(login, pass);
30. 
31.loginPage = findPage.singOff();
32.}
33. 
34.@AfterClass
35.public void tearDown() throws Exception {
36.driver.quit();
37.}
38.}

Friday, 31 May 2013

Handling untrusted SSL certificates using selenium webdriver in IE?


Some time we get these SSL errors or notification when we try to execute our scripts,At that time we need to by pass that one

SSL error in IE In the following way..













To By pass it just need to add a small piece of code when ever it occurs.

i.e

try {
                driver.get("javascript:document.getElementById('overridelink').click();");
            } catch (Exception e) {
            }

Sunday, 26 May 2013

Different ways to refresh the WebPage in selenium WebDriver


 5 different ways, using which we can refresh a webpage.There might be even more :)

There is no special extra coding. I have just used the existing functions in different ways to get it work. Here they are
  
1.Using sendKeys.Keys method

driver.get("https://accounts.google.com/SignUp"); 
driver.findElement(By.id("firstname-placeholder")).sendKeys(Keys.F5);

 2.Using navigate.refresh()  method


  driver.get("https://accounts.google.com/SignUp");   
driver.navigate().refresh(); 


3.Using navigate.to() method
 
driver.get("https://accounts.google.com/SignUp");   
driver.navigate().to(driver.getCurrentUrl()); 


4.Using get() method
 
driver.get("https://accounts.google.com/SignUp");   
driver.get(driver.getCurrentUrl()); 

5.Using sendKeys() method

driver.get("https://accounts.google.com/SignUp");  
driver.findElement(By.id("firstname-placeholder")).sendKeys("\uE035"); 







 

Selecting a date from Datepicker in Selnium WebDriver

If we look at the Datepicker, it is just a like a table with set of rows and columns.To select a date ,we just have to navigate to the cell where our desired date is present.

Here is a sample code on how to pick a 13th date from the next month.

import java.util.List;
 import java.util.List;
 import java.util.concurrent.TimeUnit;
 import org.openqa.selenium.By;
 import org.openqa.selenium.WebDriver;
 import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;;

public class DatePicker {

 WebDriver driver;
 
 @BeforeTest
 public void start(){
 System.setProperty("webdriver.firefox.bin""C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe");  
 driver = new FirefoxDriver();
 }
 
 @Test
 public void Test(){
 
  driver.get("http://jqueryui.com/datepicker/");
  driver.switchTo().frame(0);
  driver.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS);
  //Click on textbox so that datepicker will come
  driver.findElement(By.id("datepicker")).click();
  driver.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS);
  //Click on next so that we will be in next month
  driver.findElement(By.xpath(".//*[@id='ui-datepicker-div']/div/a[2]/span")).click();
  
  /*DatePicker is a table.So navigate to each cell 
   * If a particular cell matches value 13 then select it
   */
  WebElement dateWidget = driver.findElement(By.id("ui-datepicker-div"));
  List<webelement> rows=dateWidget.findElements(By.tagName("tr"));
  List<webelement> columns=dateWidget.findElements(By.tagName("td"));
  
  for (WebElement cell: columns){
   //Select 13th Date 
   if (cell.getText().equals("13")){
   cell.findElement(By.linkText("13")).click();
   break;
   }
  } 
 }
}</webelement></webelement> 

Monday, 20 May 2013

Selenium Sampleinterview Questions


  1. In your experience, what are some of the challenges with Selenium?
Some Challenges:
The use of the locators need to be carefully thought through.
Handling Dynamic Elements
Handling Ajax Call Element
Handling Http's URL's

2.What is the difference between an assert and a verify with Selenium commands?

Assert: Will fail and abort the current test execution.
Verify: Will fail and continue to run the test execution.
3.How many testing frameworks can QA Tester use in Selenium RC?
Testing frameworks aren’t required, but they can be helpful if QA Tester wants to automate test cases. Selenium RC supports Bromine, JUnit, NUnit, RSpec (Ruby), Test::Unit (Ruby), TestNG (Java), unittest (Python).

4.Does Selenium support mobile internet testing?

Selenium supports Opera and opera is used in most of the Smart phones. So whichever Smart phone supports opera, selenium can be used to test. So, one can use Selenium RC to run the tests on mobiles

5. What are the basic annotations used to run TestNG tests in Selenium?

The basic annotations used to run TestNG tests in Selenium RC:
1. @BeforeClass: The annotated method with @BeforeClass will be run before the first test method in the current class is invoked.
2. @AfterClass: The annotated method with @AfterClass will be run after all the test methods in the current class have been run.
3. @BeforeMethod: The annotated method with @BeforeMethod will be run before each test method.
4. @AfterMethod: The annotated method with @AfterMethod will be run after each test method.
5. @Test: Marks a class or a method @Test with as part of the test.

6.What is the difference between Thread.Sleep() and Selenium.setSpeed()

Selenium.setSpeed:
1. takes a single argument in string format
ex: selenium.setSpeed(“2000″) – will wait for 2 seconds
2. Runs each command in after setSpeed delay by the number of milliseconds mentioned in setSpeed.
Thread.sleep:
1. takes a single argument in integer format
ex: thread.sleep(2000) – will wait for 2 seconds
2. Waits for only once at the command given at sleep.

7.  How to configure Selenium RC with eclipse to run Junit Tests?
  1. Download eclipse. click here to download the software
    2) Open eclipse -> Workspace Launcher window will open
    3) Create a workspace by giving meaningful name
    3) Click on Workbench
    4) Create a project of type java
    5) Create a package under src folder of the package
    6) Add Junit to the build path
    7) Add selenium rc java client driver to the build path
    8) Now drag and drop your test script (.which is exported from Selenium IDE) to the package created.


8.Which browsers does WebDriver support?

The existing drivers are the ChromeDriver, InternetExplorerDriver, FirefoxDriver, OperaDriver and HtmlUnitDriver. For more information about each of these, including their relative strengths and weaknesses, please follow the links to the relevant pages. There is also support for mobile testing via the AndroidDriver and IPhoneDriver.

9.What is Web Driver?

Web Driver uses a different underlying framework from Selenium’s javascript Selenium-Core. It also provides an alternative API with functionality not supported in Selenium-RC. WebDriver does not depend on a JavaScript core embedded within the browser; therefore it is able to avoid some long-running Selenium limitations.
WebDriver’s goal is to provide an API that establishes
A well-designed standard programming interface for web-app testing.
• Improved consistency between browsers.

    10. Describe Technical Problems that you had with selenium tool
    11.Wht does SIDE Stands for
        ans:Selenium IDE
    12.What Programming Languages is best for writing the Selenium Tests
    13.Compare QTP vs Selenium
    14.Can tests recorded using Selenium IDE be run in other browsers?
Ans:Yes. Although Selenium IDE is a Firefox add on, however, tests created in it can also be run in other browsers by using Selenium RC (Selenium Remote Control) and specifying the name of the test suite in command line.

    15.What are the locators available in Selenium?
    16..What is the difference between single and double slash in Xpath
                 Ans : / selects children of the context node,
                         // selects descendants of the context node.
    17. what is the diffarence b/w TestNG and Junit

    18. Explain about your reporting method
    19. How do you handle the secured connection error in HTTPS?
    20. How do you handle Ajax controls using selenium?
    21. Diffarent Types of Automation Framework
    22.what is the diffarence between Implicit and Explicit wait in selenium
    23. How to Handle the webTable data using Selenium
    24.What is the diffarence between actions, accessors,assertions