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



No comments:

Post a Comment