Virtusa Selenium Interview Questions
Here is the list of Selenium Interview Questions which are recently asked in Virtusa company. These questions are included for both Freshers and Experienced professionals. Our Selenium Training has Answered all the below Questions.
1. Tell about yourself
- Give a brief of your education background - your family and location, any of your hobbies etc.
- Share your major achievements.
- Keep your answer in 4-5 sentence.
- Keep the answer short and simple
2. What kind of Framework have you implemented in your project?
A Test Automation Framework is a set of guidelines like coding standards, test-data handling, object repository treatment etc.
You can share which framework you are used in project like, Data-driven Framework, Page Object Model design pattern.
3. Describe the Structure of the Framework
Testing framework is a set of guidelines or rules used for creating and designing test cases. A framework is comprised of a combination of practices and tools that are designed to help QA professionals test more efficiently.
Types of Testing Framework- Linear Automation Framework
- Modular Based Testing Framework
- Library Architecture Testing Framework
- Data-Driven Framework
- Keyword-Driven Framework
- Hybrid Testing Framework
4. Write a program of Reverse of String Using String methods
// Java program to ReverseString using StringBuilder
import java.lang.*;
import java.io.*;
import java.util.*;
// Class of ReverseString
class ReverseString {
public static void main(String[] args)
{
String input = "Geeks for Geeks";
StringBuilder input1 = new StringBuilder();
// append a string into StringBuilder input1
input1.append(input);
// reverse StringBuilder input1
input1.reverse();
// print reversed String
System.out.println(input1);
}
5. How do you execute your framework test cases?
We need to specify in and out of our Test Automation Framework such as programming language used, Type of framework used, Test Base Class (Initializing WebDriver, Implicit Waits), How we separate Element locators and tests (Page Objects, Page Factory), Utility functions file, Property files, TestNG annotations, How we parameterize tests using Excel files, How we capture error screenshots, Generating reports(Extent Reports), Emailing reports, Version Control System used and Continues Integration Tool used.
6. Write a program to copy all contents from one excel sheet to another sheet?
package com.utilities.excel;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
public class MergeXSLFiles {
public static void mergeExcelFiles() {
HSSFWorkbook book1 = null;
HSSFWorkbook book2 = null;
HSSFSheet sheet1 = null;
HSSFSheet sheet2 = null;
try {
book1 = new HSSFWorkbook(new FileInputStream(
"..\\com\\utilities\\excel\\Book1.xls"));
sheet1 = book1.getSheetAt(0);
book2 = new HSSFWorkbook(new FileInputStream(
"..\\com\\utilities\\excel\\Book2.xls"));
sheet2 = book2.getSheetAt(0);
try {
AdvancedWorkbook mergedBook = new AdvancedWorkbook();
mergedBook.addSheet(sheet1);
mergedBook.setSheetName(0, book1.getSheetName(0));
mergedBook.addSheet(sheet2);
mergedBook.setSheetName(1, book2.getSheetName(0));
FileOutputStream fileOut = new FileOutputStream(
"..\\src\\com\\utilities\\excel\\Merged.xls" ,false);
mergedBook.write(fileOut);
fileOut.close();
System.out.println("Merged file has been created succesfully");
} catch ( Exception ex ) {
ex.printStackTrace();
}
} catch (FileNotFoundException e) {
System.out.println("==> File Not found");
} catch (IOException e) {
System.out.println("==> IO Exception");
}
}
/**
* @param args
*/
public static void main(String[] args) {
mergeExcelFiles();
}
}
7. What if I have 50 test cases and how do I execute all those test cases?
Step 1. Creating a TestNG.xml file for executing test
Step 2. Parallel execution in TestNG
8. What all Test Estimation Technique you know of? What Test estimation technique you applied in your project?
- PERT software testing estimation technique
- UCP Method
- WBS
- Wideband Delphi technique
- Function point/Testing point analysis
- Percentage distribution
- Experience-based testing estimation technique
9. In my browser, I face security certificate violation how do I avoid that using TestNg script? What kind of desired capability you would be using it to avoid it?
For example,
package com.example;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.remote.CapabilityType;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.testng.Assert;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
public class SSLExample_Chrome {
private WebDriver driver;
@BeforeClass
public void setUp() {
DesiredCapabilities capability = DesiredCapabilities.chrome();
// To Accept SSL certificate
capability.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);
// setting system property for Chrome browser
System.setProperty("webdriver.chrome.driver", "E:/chromedriver.exe");
// create Google Chrome instance and maximize it
driver = new ChromeDriver(capability);
driver.manage().window().maximize();
}
@Test
public void openApplication() {
System.out.println("Navigating application");
driver.get("https://cacert.org/");
WebElement headingEle = driver.findElement(By.cssSelector(".story h3"));
// Validate heading after accepting untrusted connection
String expectedHeading = "Are you new to CAcert?";
Assert.assertEquals(headingEle.getText(), expectedHeading);
}
@AfterClass
public void tearDown() {
if (driver != null)
driver.quit();
}
}
10. How do you change your webdriver to run in remote machines?
11. Explain Framework Implementation in your project
For example,
Type of Framework: In our project, we are using Data-driven Framework by using Page Object Model design pattern with Page Factory.
12. What all Challenges you have faced in selenium?
- Sometimes our web application may not response the same in different browsers, and there might be a possibility that our website works fine on Chrome but not on Firefox.
- The major challenge faced in automation is test scalability.
- Sync issues are one of the primary reasons for our automation script failure.
Free PDF : Get our updated Selenium Course Content pdf
13. Do you have the knowledge of continuous integration like Jenkins?
Jenkins offers a simple way to set up a continuous integration and continuous delivery environment for almost any combination of languages and source code repositories
14. Draw the architecture diagram of selenium inplementation in your project
15. Expalin what sdlc model you are using in ur project
Most important SDLC models are
- Waterfall Model
- Iterative Model
- Spiral Model
- V-Model
- Big Bang Model
Iterative model are using in my project. This model gives you a working version early in the process and makes it less expensive to implement changes.
16. How can you check whether a particulat text present in a webpage. What are the predefined method in selenium for checking this?
Use the below code :
List < WebElement > list = driver.findElements(By.xpath("//*[contains(text(),'" + text + "')]"));
Assert.assertTrue("Text not found!", list.size() > 0);
17. How to check whether the check box is selected or in unselected without using?
isSelected() above method is used to check whether the check box is selected or in unselected.
It returns Boolean value – Its true
Otherwise - false
18. How to find whether the element is in visible or in hidden?
element instanceof RenderedWebElement use this syntax for find whether the element isin visible or in hidden
19. Difference between findElement and findElements
findElement | findElements |
---|---|
Syntax is : WebElement elementName = driver.findElement(By.LocatorStrategy("LocatorValue")); | Syntaz is : List |
Returns the first most web element | Returns a list of web elements |
XPath will only find one web element | It will find a collection of elements whose match the locator strategy. |
20. How you will handle pop up windows?
getWindowHandles() method is used to handle popup windows.
21. What is testng
TestNG means Test Next Generation is the testing framework. It is inspired from JUnit and NUnit, but it has a new functionality that makes this framework more powerful and easier. TestNG is designed in such a way that it covers all the categories of tests comprising unit, functional and integration.
22. How you are handling keyword driven and datadriven framework in your project
- Identify all the actions to be performed for automated testing of an application
- Create a keyword map table in the Excel sheet.
- To place the Excel sheet in a package of the project. Create a package named ‘excelData’ by right clicking on the Project.
- Create a new package
- Write code for each action keyword
- write code to read data from an Excel sheet.
- Create a new package and write code
23. What is mean by hybrid framework?
The Hybrid framework is one which has a flavour of Data Driven as well Keyword Driven. As discussed in earlier tutorials, Data Driven is one which is derived from external data, whereas Keyword Driven is one which has keyword driving the execution, say for example “openbrowser” is a keyword which will open a browser of your choice and perform required action.
24. How can you upload file in webpage?
Use below code for upload file in web page
driver.findElement(By.xpath(“input field”)).sendKeys(“path of the file which u want to upload”);
25. How you will handle popup in webdriver?
String mainPage = driver.getWindowHandle();
Alert alt = driver.switchTo().alert(); // to move control to alert popup
alt.accept(); // ok.
alt.dismiss(); // cancel.
//Then move the control back to main web page-
driver.switchTo().window(mainPage); → to switch back to main page.
26. What are the Tools you know?
Top different testing tools are,
p>- Test Management Tool
- Automated Testing Tools
- Cross-browser Testing Tools
- Load Testing Tools
- Defect Tracking Tools
- Mobile Testing Tools
- API Testing Tools
- Security Testing Tools
- CSS Validator Tool
HR Round
27. Why looking for change?
Interviewer expect positive answers from your side like career growth, Interest to learn new skills, like to work with new environment. Also don't Be Negative About Your Current Job or Employer.
28. Your positives & negatives.
Talk about the environment and culture of the company, and how you feel it is a strong match with your strengths and experience.
When addressing your weaknesses, draw upon examples relating to either skills/habits or personality traits. You may want to choose which to focus on depending on the type of job you’re interviewing for.
29. If we hire you: what would be the 3 things you will be looking for?
The hiring manager is gauging your response to determine if you are the perfect person for this job. When asked, “why should we hire you?”, tread lightly and have a few different answers prepared in advance.
30. Ready for relocation?
Your Answer is like, this is a great opportunity and a position I believe. I am interested to working in this area, but I would consider relocating depending on the circumstances.
31. Current CTC and Expected CTC?
You need to ready advance in the answer. If the interviewer asking expected CTC, you can explain your research the market and salary trends
Book a Free Mock Interviews and Test your Selenium skills with our Experts
TOP MNC's SELENIUM INTERVIEW QUESTIONS & ANSWERS
Here we listed all Selenium Interview Questions and Answers which are asked in Top MNCs. Periodically we update this page with recently asked Questions, please do visit our page often and be updated in Selenium.
Related Blogs
To become a Selenium Certified professional and join in your dream company, Enroll now for our Best Selenium Training. We help you to crack any levels of Selenium Interviews and We offering Selenium Training with Placement Assistance.