Showing posts with label Question asked in each interview to a tester. Show all posts
Showing posts with label Question asked in each interview to a tester. Show all posts

Saturday, July 5, 2014

How to verify the text present in my web page.

There could be two ways to verify text present in web page or not-
1) Find that element where that text is populating and use getText() method then verify.
2)1st Get the page source using getPageSource() method then verify.

Ex-

import java.util.concurrent.TimeUnit;

import junit.framework.Assert;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

public class VerifyTextPresentInWebPage {
    public static void main(String[] args) {
        WebDriver driver = new FirefoxDriver();
        driver.get("http://www.goibibo.com/");
        driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
       
        //verify 'International Flights' text is there in the web page or not
        String expText = "International Flights";
       
        //first way to verify by using locator and getText() method
        String actText = driver.findElement(By.xpath("//a[@class='hm_inactive']")).getText();
        if(actText.contains(expText)){
            System.out.println("1) Expected text '"+expText+"' present in the web page.");
        }else{
            System.out.println("1) Expected text '"+expText+"' is not present in the web page.");
        }
       
        //second way to verify by using getPageSource method
        String pageSource = driver.getPageSource();
        if(pageSource.contains(expText)){
            System.out.println("2) Expected text '"+expText+"' present in the web page.");
        }else{
            System.out.println("2) Expected text '"+expText+"' is not present in the web page.");
        }
        driver.close();
    }
}


Thursday, June 5, 2014

Tell me about yourself

Note- Here i am giving my introduction so you can change accordingly. Please don't tell mine. :P ;)

Tell me about yourself-
Ans- Hello Name/Sir/Mam, my name is Sanjay Kumar, I am from Mahoba Uttar Pradesh. I have completed B-tech from HBTI Kanpur with 76% in 2011. Then I joined IBM as campus hire in Noida in July 2011. there I got the training and then got the project in Bangalore and from then I am working in IBM..
Currently I am working in ABC(tell full Name of  the Project) which is an IBM internal project. And our client is ABCD(tell full name of the client).
(Then tell about your Project in brief)
ABC(Project Name), the world's largest IT financier, has an asset base of nearly $31 billion and delivers financial services to 125,000 customers in more than 40 countries.
ABC Project manages the financing contracts and financed assets of IBM. It enables customers of IBM machines to prepare financing proposals for all business transactions like New Lease, New Loan, Mid-Lease, End of Lease etc. This system has features for Contract management, Billing Invoice generation and Accounting.
The Custom Development Team adds new functionalities to the system on a regular basis and 1 major release is implemented every year. Also, the team sets up and installs the customized version of the system for new countries with which client wants to do business.
Currently I am working in the AB(name of your team or functionality) functionality. AB is a web interface, where entitled Customers can make or view Decisions on the End of Lease of their Assets which are on the verge of End of Lease with A(client Name). Besides, during the Lease period, Customer can view details of the Assets/Leases.

(Then tell)
Roles and Responsibilities:  
  1.     Identify Test cases for Automation.
  2.     Developing methods for repeating steps.
  3.     Writing scripts, executing test cases and debugging.
  4.     Prepare automation scripts in Selenium WebDriver.
  5.     Designing Automation Framework and Implementing Automation Framework.
  6.     Regression Testing, support and reviewing Test scripts.
  7.     Data driving Test script.
  8.     Defect reporting, Executing Framework and Analyzing Result.
  9.     Preparing script execution report.
  10.     Responsible for guiding juniors.
Note: Again requesting you please tell your Project description above is just for reference. This all info is just a thought which i made for reference for everyone so that one can understand how to tell in interview.

Roles and Responsibilities

Roles and Responsibilities: (Tell according to yours)
  • Identify Test cases for Automation.
  • Developing methods for repeating steps.
  • Writing scripts, executing test cases and debugging.
  • Prepare automation scripts in Selenium WebDriver.
  • Designing Automation Framework and Implementing Automation Framework.
  • Regression Testing, support and reviewing Test scripts.
  • Data driving Test script.
  • Defect reporting, Executing Framework and Analyzing Result.
  • Preparing script execution report.
  • Responsible for guiding juniors.

SDLC (Software development life cycle)

SDLC-(Software development life cycle)- SDLC are the different stages of developing a software or it is a step by step procedure to develop a s/w.
1-Requirement → 2-Feasibility study → 3-design (high level design, low level design) → 4-coding → 5-testing → 6-installation/deployment → 7-Maintenance.
1-Requirement- in this stage the complete needs of a customer will be collected in the form of requirement document.
2-Feasibility Study- in this phase based on requirement it is analysed whether the project is feasible or doable wrt time, cost, resources and technology. All imp people like finance dept, HR, architect, BA and PM will do the feasibility study.
3-Design- in this phase a blueprint of the requirement is developed in the form of HLD or LLD.
4-Coding- Once design is completed a set of people known as developers will start writing the code or programs according to requirements.
5-Testing- once coding is completed i.e. an application is developed it should be tested if it is working according to the requirements or not. This process of testing the application according to the requirement is called as testing and this task is performed by test engineer.
6-Installation- Once the application is tested, developed and stable it should be installed at customer place.
7-Maintenance- Once the application is installed at the customer place it is possible that they may face some issues and these issues may be fixed immediately by the company by giving them support for certain period of time. This phase is called as Maintenance.

What are the challenges you faced ?

What are the challenges you faced : 1- sometime developers were not accepting the bug then I have to show them in meeting and had to give them demo of bug.
2- sometime I got inconsistent bug, its changing everytime. Then it was very difficult me to show them then I have taken executed the same testcase many times and took the screenshot of all the scenarios and shown them to developers.
3- In the 1st release when I joined customer was asking very frequently changes.

STLC-(Software test life cycle)

STLC-(Software test life cycle)-
It is a step by step procedure to test a software. It consists of all the different phases or stages of testing the application and it is a part of SDLC. It consists of various phases-
System Study → Test Plan → Test Cases → RTM/CRM → Test Execution → Defect Tracking → Test Execution Report → Closure.
Test Cases → System Study → write the test scenario → write TC's → TC review → fix review comments → TC approval → store in TC repository.

BLC/DLC-(Bug/defect/thread life cycle)

BLC/DLC-(Bug/defect/thread life cycle) :
Bug Status [new/open] (TE) → [Assign](lead) → [fixed] (developer) → [Re-Test] (TE) as well as test the impacted area (regression in BLC) → if pass then [close] else if fail then [re-open] and again go to assign.
As soon as we get a bug we should prepare the bug report (status will be new/open) and assign it to the concerned person. The bug will be fixed by developers and send back to the TE for re-testing. The TE will retest the bug and if it is fixed properly he will change the status of bug to close or else if the bug is not fixed the TE will re-open the bug and assign it back to the concerned person.

Agile Methodolgy

Agile development model is also a type of Incremental model. Software is developed in incremental, rapid cycles. This results in small incremental releases with each release building on previous functionality.
Advantages- Customer satisfaction by rapid, continuous delivery of the useful softwares. People interact with each other much. Face-to-face conversation is the best form of communication. Continuous attention to technical excellence and good design.
Disadvantages- In case of some software deliverables, especially the large ones, it is difficult to assess the effort required at the beginning of the software development life cycle.
There is lack of emphasis on necessary designing and documentation.

Monday, June 2, 2014

Why framework is needed and what are the uses ?


Ans - Framework is a set of guidelines like coding standards , test-data handling , object repository treatment etc... which when followed during automation scripting produce beneficial outcomes like increase code re-usage , higher portability , reduced script maintenance cost etc. Mind you these are just guidelines and not rules; they are not mandatory and you can still script without following the guidelines. But you will miss out on the advantages of having a Framework. So its always best practice to have good framework.

For more details about framework, please refer below link-


Sunday, June 1, 2014

How to explain the framework to the interviewer.

In our project Your_Project_Name (ex- CustomerCentre) , we are using Hybrid Framework(why framework required) which is the combination of Data Driven, Method Driven and Modular Driven Framework. Basically this involves 3 stages-

1) Designing the framework,
2) Implementing the framework,
3) Execution of the framework.


1) Designing the framework-

 

a) while designing the fw in anyone of the local drive create a folder by name HybridFramework. Launch the eclipse, set the workspace to HybridFramework.
b) in eclipse create a java project by name CustomerCentre.
c) in eclipse under CustomerCentre proj create a folder Jars & to that Jars folder include all the jar files related to the project such WebDriver jar, poi jar etc.
d) in eclipse under CustomerCentre proj create another folder by name Drivers to this folder copy all the executable files or driver such as Chrome Driver, IE driver and so on.
When designing the framework there are methods which can be used in more than one project such methods we call it as Generic method. And there are methods which are related to only one single project those methods are called as project specific method.
Naming convention for package- com.projectname.packagename (com.CustomerCentre.Library)
All the methods related to Generic, we write them under GenericLibrary class which is present in the Libraries package. And all the project specific methods are written under ProjectSpecificLibrary class which is present under libraries package.
All the GenericLibrary method should be public as well as static. Like – getLastRowNum, getCellValue, setCellValue, etc.
In the application there are certain types of steps which has to be used again & again such as open browser, open application & so on. In order to handle these types of steps we create ConfigLibrary (SuperTestNG) class in which we have written the methods by using Selenium annotations like @BeforeMethod, @AfterMethod etc. so that we need not to write the code for repeating steps each time. Inharit this class from all other classes to use these class methods.
We create an excel file by name Config, in which we wrote all the input data for the testing and then copy the entire excel file, and paste it under the CustomerCentre project.
To confirm everything working fine or not, we create a dummy package with dummy @Test method. If browser is getting launched, app is getting launched & browser is getting closed i.e. whatever we have developed till is correct. Then delete the dummy package.
To perform the validation, we create one more class Assertion. Whenever we need to perform validation we need to call assertText() or assertTitle() present under the Assertion class. (Assert.assertEquals())
 

2)- Implementing the ProjectSpecificLibrary- 

 

This is where actual implementation of the framework start. While going thru the manual testcases we note down the common repeated steps and make those steps as a project specific methods. Even if one step is repeating , may be in same testcase or other testcase make it as a method. Then write the test script for all the manual test cases.

 

3)- Execution-

 

 Right click on the project, navigate to TestNG → convert to TestNG → give the proper suite name and test name and click on finish. Then execute this xml file (ctrl+f11) or right click and run as TestNG Suite. Or to run thru cmd → navigate till project then give this commnd-

java -cp bin;jars/* org.testng.TestNG testng.xml


Explain with the below diagram that will be more impressive.