Showing posts with label Interview Questions. Show all posts
Showing posts with label Interview Questions. Show all posts

Tuesday, 5 August 2014

Selenium WebDriver – Interview Questions

1: What is Selenium Web Driver?
Answer:  Selenium Web driver uses accessibility API to drive the browser and recognizes the object in web-based application. It allows writing automated tests replicating the behavior of real user, e.g. Clicking on a link or feeding data in an edit box. Using Selenium Web Driver together with any programming language and other testing framework like TestNG and JUnit, automation test framework to execute tests on different browsers can be created. We can use the robust features of the programming language to interact with other components of application like database interaction, files interaction to create a robust and reliable framework.
 2: What are the various browsers supported by Selenium WebDriver?
Answer: WebDriver available for automation in different browsers are ChromeDriver, InternetExplorerDriver, FirefoxDriver, OperaDriver and HtmlUnitDriver.
 3: What are the programming languages supported by WebDriver?
Answer: Python, Ruby, C#, Java, Perl, php and javascript are supported.
 4: What are the necessary steps required, before I start creating selenium tests on java using eclipse?
Answer: We require following configuration to be set up before creating test in eclipse:
  1.  Java needs to be installed in the machine.
  2.  Eclipse IDE needs to be installed.
  3.  Selenium Libraries for WebDriver should be available.
 5: Do we need to install some additional executable files working with Selenium WebDriver?
Answer: For Firefox driver, we do not require any additional executable as it is bundled with Java client bindings, For IE driver, Chrome driver, and Opera driver, we require additional executable that can be downloadable from Selenium Official website.
An example of how to create an instance of Internet Explorer Web Driver is shown in below example.
6: Is there any specific pre-condition before executing a selenium script on Internet Explorer?
Answer: Yes, Protected Mode settings should be same for all zones. Enable Protected Mode must be set to the same value (enabled or disabled) for all zones.
 7: What are Firefox profile preferences?
Answer: Using Firefox Profile, we can set the preferences for the Firefox in the profile.
The steps to define profile in Selenium are:
1.  Create an object of firefox profile
FirefoxProfile profile = new FirefoxProfile();
2.   Set the required preference of the firefox :
profile.setPreference(“browser.startup.homepage”,”http://www.google.com”)
3.  Create the driver object with profile as defined above.
WebDriver driver = new FirefoxDriver(profile);
8: What is the use of using TestNG with selenium in Java?
Answer: TestNG is a unit testing framework used for java programming language. Test Cases using Selenium Webdriver to identify webelement in the web application can be integrated/created on TestNG framework. Some of the useful features TestNG provides are as follows:
1.  Using Annotation to describe order of test cases, defining start conditions and end condition using  @after and @before annotations.

Selenium IDE: Interview Questions with Answers

1:  Explain the various features provided by Selenium IDE?
Answer: The layout of Selenium IDE is divided into following four areas:
1. MenuBar – Following are the menu options available in Selenium IDE:
 a.   File – Allows creating new test case, test suite, open existing test case, test suite, exporting tests to other formats.
 b.   Edit – Allows editing existing test steps, and adding new commands and comments.
 c.   Actions – Allows to record, play a test, execute command, toggle breakpoint and set entry point.
 d.  Options – Allows the changing of settings including set the timeout value for commands and specifying the format used for saving test cases.
 e.  Help – provides documentation for selenium IDE.
   2.  Toolbar – Provides buttons to manage test execution including test execution and test execution.
   3.  Test Case Pane – Test Case Pane shows the list of test case on the left and test steps in table or
source pane on the right. We can add/modify commands, target and value in the table for the test.
    4.  Log/Reference/UI-Element/Rollup Pane – This pane helps us to view logs of execution, reference explaining the selected command. We can also set to filter logs for info, warning, error and debug in this window.
 2: Explain what are the various items available from file menu
Answer: From the File Menu, We can perform various tasks
a.  Create New Test Case.
b.   Create new Test Suite.
c.   Save test cases and test suites.
  1.    Export Test cases/test suites to various formats. E.g : Ruby/Python/java/c# with WebDriver or RC.
  2.   Open existing test cases and test suites.
d.   Rename a test case.
3: Can the script prepared in Selenium IDE be used with webdriver/Remote control?
Answer: Yes, the script created in Selenium IDE can be exported to WebDriver/Remote Control in the languages java/c#/python/ruby that can be run using junit(java), RSpec(ruby), nUnit.
4: My Application is running slowly, can I change the default timeout value of recorder command?
Answer: We can reset the default timeout value for recorded command from Options Menu. By default the timeout is set as 30000 ms. In options, we can also define the recording settings and order of locator preference for object identification.
 5: What is the short cut key to create a new test in Selenium IDE?
Answer: The shortcut key to create a new test in Selenium IDE is Ctrl + N.
Some other useful shortcut keys in Selenium are:
Open a test – Ctrl + O :  Save a test – Ctrl + S  : Add test to test suite : Ctrl + D.
 6: What is the use of Select and find button in target in Selenium IDE?
Answer: On clicking on select, we can add the locator of an element in the page. Click on Select and click on an element in the page, the locator for the element will be added in the target. Find helps us to verify object exists in the page and highlights the object in the page if exists, else error is displayed in the log.

Activities in Testing Process

Testing Process includes following activities that should be followed sincerely for proper testing.
1. Test Planning
 Before beginning with testing, we need to define test plan based on which we perform testing for the rest of testing life cycle. We should develop a test plan based on following key points to be considered in testing life cycle.
  • Test Objectives should be measurable, prioritized, and should be signed off between stakeholders before moving forward with test planning. Acceptance Criteria should also be defined during objective settings to validate if the test objective has been accompanied.
  • Test Matrix should be defined on how to test the test objectives and to validate all the requirements are covered in testing.
  • Test Schedule should be defined, how milestones in testing will be covered and timeframe in which milestones will be delivered
  • Budgeting and resources planing should be defined.
  • Testing material including environment ans software/availability should be defined.
  • Training required for testing should be defined.
 2. Test Control Activities
Once Test plan is created and signed off by stakeholder, Activities in test plan should be compared with actual and any deviation from the projected plan should be reported to stakeholders as risk.

3. Test Analysis
In this phase, test objectives defined in test planning are converted into test scenarios and test cases.Below are the main task in this phase:
  • Reviewing the test artifacts like business requirements, design, and test objectives.
  • Identifying and prioritizing test scenarios and test cases based on business requirements.
  • Identification of test data for execution of test conditions
  • Test environment availability
 4. Test implementation
Below are activities in test implementation
  • Developing and prioritizing test cases with test steps
  • Preparation of test data for execution of test scripts.
  • Environment set up for testing.
  • Development of automation test harness.
  • Preparation of test suites for regression, smoke testing, and execution of similar tests in batch.
 5. Test Execution and Reporting
  • Execution of test scripts either manual or automated.
  • Reporting defects found during test script execution.
  • Regression testing and retesting of fixed defects. 
  • Reporting of test execution status to stakeholders.
 6.  Exit criteria
  • Evaluating Testing status against the exit criteria specified in test planning.
  • Test Status should validate that all acceptance criteria are verified.
 7. Test Closure Activities
  • Delivering all the planned test artifacts to the client. For e.g : Automated Test Scripts,test scripts, test data for further reuse.
  • Handover of artifacts and knowledge transfer to maintenance team
  • Analysis of lesson learnt during testing process.

Thursday, 10 July 2014

Selenium Online Training by Quontra Solutions

We are pleased to supply a lot of information and a dozen of free hands-on tutorials. All the available tutorials are surrounded with screenshots and downloadable code samples. This blog is created and will be maintained by Quontra Solutions. Quontra solutions Trainers have many years of experience in automated testing. Quontra Solutions is particularly interested in web technology and new programming languages. We are always trying to find a way to transfer knowledge to Students who are interested in the automated testing of software.
A variety of topics will be covered on this blog. Starting with recording tests with Selenium IDE and locating web elements and furthermore the use of design patterns and performance measurement to create a robust testing framework.
Selenium Tutorial using C# and NUnit
In this tutorial we are going to learn how to create your first test script using the language that most commonly used, c#. Since most languages are semantically the same, if you do not use c# it shouldn’t be too difficult to translate the tutorial into your language of choice. You have to download Nunit and at least Visual Studio Express c# edition to complete this tutorial. They are free to download and use.
  1. Follow steps 1-4 of Selenium Remote Control HTML Suite Tutorial. This will get the Selenium Remote Control Running.
  2. In Visual Studio let’s create a new project. You will have to create a new class library by going New> New Solution> Class Library and call it TheAutomatedTester
  3. Add a reference to the NUnit Framework by rightclicking on the solution and clicking add reference. Click on the browse tab and navigate to <%nunithome%>\bin and select nunit.framework.dll . This allows you now to create your first NUnit test.
  4. Now in the *.cs file put the code below into it. The code below will call Selenium Remote and say that it needs an instance on Firefox Chrome.
  1.        [TestFixture]
  2.        public class TheAutomatedTester
  3.        {
  4.                private ISelenium selenium;
  5.            private StringBuilder verificationErrors;
  6. [SetUp]
  7. public void SetupTest()
  8. {
  9.        selenium = new DefaultSelenium(“localhost”, 4444, “*chrome”, “http://localhost”);
  10. selenium.Start();
  11. verificationErrors = new StringBuilder();
  12.    }


  1. Now Lets create a test:
  1. [Test]
  2. public void AutomatedTester_Test()
  3. {
  4. selenium.Open(“/index.htm”);
  5. selenium.Click(“buttonName”);
  6. selenium.WaitForPageToLoad(“30000″);
  7. }
The code above would open the page index.htm for the root of your local web server then click on a button and wait for a page to load. If you want to see how to the other commands look I would suggest creating your command in Selenium IDE and then converting them to c# using the Options > Format commands.
  1. Once your test has run you will need to clean up Selenium object. The best way to do this is to create a teardown function in your test. It should look like something like the code below.
  1. [TearDown]
  2. public void TeardownTest()
  3. {
  4. try
  5. {
  6. selenium.Stop();
  7. }
  8. catch (Exception)
  9. {// Ignore errors if unable to close the browser
  10. }
  11. Assert.AreEqual(“”, verificationErrors.ToString());
  12. }
If you make sure that your code has this teardown then you will be able to reuse the Selenium Remote Control.
  1. Now compile the code into a DLL and Open it with NUnit. When you click the Run button in NUnit it will run your Selenium Test.
If you would like to make your test data driven put all the code to pull the data in the SetUp

Friday, 4 July 2014

Usage of sql jdbc 4.0 driver

This post is related to using sql jdbc driver 4.0

If you are using sql jdbc driver then these are things to note and follow:
1) Download sqljdbc driver from http://www.microsoft.com/en-in/download/details.aspx?id=11774
2) Now if your jdk is 32-bit then set the 32-bit driver path to your system property or 64-bit if your jdk is 64-bit
3) Now if you are using integrated security then copy the authorization .dll to your system32 folder and set that property to your system path as well.
4) If you still get issues with it then let us know