D&B – Selenium Interview Questions
Here is the list of Selenium Interview Questions which are recently asked in D&B company. These questions are included for both Freshers and Experienced professionals. Our Selenium Training has Answered all the below Questions.
Round-1-Written test
1. 10+ questions from basic programming, loops, continue, breaks.
2. 10+ questions from selelium drivers, xpath, cssSelector.
3. 5+ questions from Java programming outputs like inheritance, looping outputs
Round 2:1. Tell me about yourself
Answer according to your profile and experience.
2. About the fremework, which currently using
Answer according to your project
3. Compare between Data driven & Keyword driven
The important points to be note down between Data driven & Keyword driven are listed down below,
In data driven testing, we can run our tests on multiple data in multiple combinations with the help of parameterization.
In keyword driven testing, the keywords that are developed represent an action.
The data driven framework revolves around the data.
In keyword driven testing, the entire team consisting of both automation and manual testers can both contribute for testing the product.
4. About Maven, Jenkins and ANT
Maven:It is a tool which is used for building and managing Java Based Projects. Basically to put it in simple words is a way to manage dependency for Java Based Project. Maven can be used when building project with POM (Page Object Model) when working on big projects
Jenkins:
The leading open source automation server, Jenkins provides hundreds of plugins to support building, deploying and automating any project.
ANT:
Ant is a build tool for Java. Ant used for code compilation, deployment, execution process. Ant can be downloaded from Apache website.
5. TestNG annotations and clarify the each annotations.
TestNG is a testing framework created by Cédric Beust and helps to cater a lot of our testing needs. It is widely used in Selenium. Annotations are taken from the Java language and are an excellent tool for the testers using TestNG.- BeforeSuit
- BeforeTest
- BeforeClass
- BeforeMethod
- Test Case
- AfterMethod
- AfterClass
- AfterTest
- AfterSuit
6. What is current role in Test automation
Answer according to your job
7. How do you rate yourself on Java?
Practice a one or two sentence summary of why you deserve a particular number. Then it might not hurt to actually say a number one lower than you think.
8. Write a Java program ‘to read a statement from a file and tell the word count & char count
import java.io.BufferedReader;
import java.io.FileReader;
public class CountWordFile
{
public static void main(String[] args) throws Exception {
String line;
int count = 0;
//Opens a file in read mode
FileReader file = new FileReader("data.txt");
BufferedReader br = new BufferedReader(file);
//Gets each line till end of file is reached
while((line = br.readLine()) != null) {
//Splits each line into words
String words[] = line.split(" ");
//Counts each word
count = count + words.length;
}
System.out.println("Number of words present in given file: " + count);
br.close();
}
}
9. Tell me about Grid and where and when you are using it?
Selenium Grid allows us to execute multiple instances of WebDriver or Selenium Remote Control tests in parallel which uses the same code base, hence the code need NOT be present on the system they execute. The selenium-server-standalone package includes Hub, WebDriver, and Selenium RC to execute the scripts in grid.
10. Whate are all the reports you are using?
- TestNG Reporting Tool
- ReportNG
- Allure
- JUnit
Free PDF : Get our updated Selenium Course Content pdf
11. Give the formate of xml report. Do you have chart on your report?
Answer according to your project
12. How do you maintain the selenium code [I said GIT]?
- Keep Your Automation Designs Simple, Yet Strategic
- Establish Process For Keeping Automation Updated
- Inspire Developers For Keeping Testing In Mind
- Identify Flaky Tests And Work On Reducing Them
13. Suppose two people are saving the code in GIT version controller, what would happen?
14. Which version of selenium are you currently using?
Selenium 4.0. 0 Alpha 5,
15. What are all the advanced features in it [2.44] compare to prior version?
- Capture screenshot of specific web element
- Open the new tab on the browser
- Open a new window on the browser
- Chrome Dev tools
16. Print Prime numbers using Java Program
public class PrimeExample{
public static void main(String args[]){
int i,m=0,flag=0;
int n=3;//it is the number to be checked
m=n/2;
if(n==0||n==1){
System.out.println(n+" is not prime number");
}else{
for(i=2;i<=m;i++){
if(n%i==0){
System.out.println(n+" is not prime number");
flag=1;
break;
}
}
if(flag==0) { System.out.println(n+" is prime number"); }
}//end of else
}
}
17. Read and write file from Excel, MS AccessDB and Text File.
18. How do you run multiple suite and few more basic questions on Project experience?
Create a new project in eclipse
Create two packages in the projects (name them as com.suite1 and com.suite2)
Create a class in each package (name them as Flipkart.java and Snapdeal.java) and copy the below code in respective classes
Create a new file in your project and name it as testng.xml (Make sure you've installed testing plugin for eclipse, instructions available here). Testng.xml contains all configuration (classnames, testnames and suitnames).
19. Make yourself strong in Collections, File handling, Exception handling and JDBC from Java
20. Practice basic interview related programs of Java
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.