80% found this document useful (5 votes)
11K views13 pages

Selenium and Java Interview Questions

The document provides interview questions asked by various companies for Selenium and Java positions. For Selenium, the questions cover topics like TestNG annotations, parallel test execution, locators, data-driven testing frameworks. For Java, common questions asked relate to OOP concepts like inheritance, polymorphism, exceptions, collections framework, threads. Sample programs are also included to test candidates on basic programming skills for problems like string manipulation, searching, sorting.

Uploaded by

Kumar Saheb
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
80% found this document useful (5 votes)
11K views13 pages

Selenium and Java Interview Questions

The document provides interview questions asked by various companies for Selenium and Java positions. For Selenium, the questions cover topics like TestNG annotations, parallel test execution, locators, data-driven testing frameworks. For Java, common questions asked relate to OOP concepts like inheritance, polymorphism, exceptions, collections framework, threads. Sample programs are also included to test candidates on basic programming skills for problems like string manipulation, searching, sorting.

Uploaded by

Kumar Saheb
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

All CMMI-Level-5 companies Selenium Real Time Interview questions , questions are

collected with my students who ever all ready got placed,

====Please take a print out========================

VM Ware

Below are the Questions are asked in my 3 rounds of technical interview:


--------------------------------------------------------------------------------------
1. What are the different types annotations used in TestNG? How to use the
@Beforesuite and @AfterSuite annotations in TestNG?
2. How do we achieve parallel execution in TestNG?
3. What are the different arguments are passed along with @Test annotation in TestNG?
4. How do we include and exclude the groups in the TestNG xml file?
5. How to use the dataprovider in TestNG with an example?
6. How do u idenityfy the objects? In what scenarios these locators are
used? Ex: name, id, xpath, linktext, csslocator, Partial linktext
7. Difference between Datadriven and Hybrid Frame work?

Java:
----
1. What is Abstract class? Where we will use Abstract Class in java?
2. What is interface? Difference between Abstract class and interface?
3. Difference between normal methods and Abstract methods in Java?
4. Why we are using constructors in java?
5. Difference between overloading and overriding ?
6. Explain "static" keyword in java and it's usage?
7. Why multiple inheritance is not supported in java?
8. Difference between "extend" and "implement" in java?
9. Explain the access specifiers public, Private, protected and default in

java with their visibility and security?


10. What are the difference between primitive and derived data types?
11. Difference between final, finally and finalize method in java?
12. How do we handle the exceptions in java? and Exception hierarchy in
java?
13. Why we are using finally block in java?
14. Can we handle the exception with try and without catch block?
15. Write a java program for whether the given string is palindrome or not?
16. Difference between String constant and String non-constant pools?
17. Give the example for String immutable code?
18. Difference between "==" and "equals()" in String class?
19. How to compare the two strings in java?
20. How to sort the elements in the Array? Syntax of the Array?
21. What is Collections Framework in Java?
22. What are the difference between Array and ArrayList in java? Give the
examples for each?
23. What is Set in the Collections? How to move from element to another
element in the Set?
24. Usage of Iterator interface?
25. How to use HashMap in the collection and sample code?
26. How many ways to implement Threads in java?

HCL
HCL interview Question
===================================
1st technical
From Java
[Link] is the Difference between final,finally,finalize
[Link] is the difference between Call by value and call by referance
[Link] to find out the length of the string without using length function
[Link] to find out the part of the string from a string
[Link] between throw & throws
[Link] is binding(Early and Late binding)
He give Programes
[Link] a number
2.1,2,3,4,5,65,76,5,,4,33,4,34,232,3,2323,
find the biggest number among these
simple string programe.
what is exception types of exception
From manual
what is the testcase technique
why we write test case.
bug life cycle
what are the different status of bug
what is the different between functional and smoke testing
what is STLC.
from Selenium
what is testng and its advantage
how to handle SSl/
how to handle alert
how to take screenshot
give the diagram write a scrpt..
tell me about Project .What are the challenge face during project
what is the difference between RC and webdriver
what is freamwork explain it.
why we use wait statement.
2nd technical
he gives a application & tell to write the scenario
some manual testing concepts.

====================================
HappyestMind & Ness
===================================

Selenium
[Link] the syntax of drop down
[Link] is Webdriver-Java interface
[Link] is the current Version of Selinum webdriver
[Link] to get the text value from text box
[Link] x="ABC";
String x="ab"; does it create two objects?
[Link] a program to compare the strings
[Link] a
{
}
class b extends a
{
}
A a= new A();
B b=new B();
A a= new B();
B a=new A();
Which is valid and invalid?
[Link] to handle differnt type of pop up.(Wnidow,Alerts,Invisible popup)
[Link] to handle DropDown menu
10. How to handle SSL certificate
[Link] to handle Google search text.
12. How to handle dynamic text box which contains the 3 numbers, get
the number and add the three number and add it other text box.
[Link] to handle Ajax Objects
[Link] webdriver architecture
[Link] File downloading
[Link] File attachments other that Auto IT
[Link] the syntax for finding the row count in dynamic web table
[Link] between class and Interface
13. What type of class is the string class
[Link] are the differnt methods that are used along with Xpath
[Link] Interface
16 Explain Abstract
[Link] is selenum grid
18 what is selenium RC
[Link] is key word drivern frame work only choosen,
1. how to handle dynamic object
2. how to work with button which is in div tag and and u have to click
without using xpath
3. JVM is dependent or independent platform

[Link] many Test script you write in day


5. describe your framework
6. how to parameterized your junit
[Link] to handle ssl security
8. how to handle window pops
9. diffnct between implicit and explicit
[Link] are the types of assertion and what are assertion in junit
[Link] to handle ssl certificate
[Link] is dom concept
[Link] is the challenges u have faced during Automation
14What is genrics
[Link] is synchronization
Java
[Link] is dependent or independent platform
[Link] bw hashmap and hash set, set and linkedlist, arraylist and
vector list , linkedhash set and hashset
[Link] and interface
[Link] and throws
[Link] to split
[Link] and unchecked exception
[Link] to work with azax aplication
[Link] sring is immutable
[Link] is the retru ntype of getwindowhandles();
[Link] are the types of assertion and what are assertion in java
[Link] between interface and Abstract classes
[Link] is static varaible
[Link] is volitile
14. what is trainsient
[Link] is the differnece between Final,Finalize and finally
[Link] is the differnce between Public,private and protected

==========================================
FICO
===========================================

[Link] is the default package in java ?


2.: why we use interface why not abstract class ...what if i implements same method in
interface and abstract ....thn ?? any diffrnc??
3. what are inner classes ..name them ?
[Link] public static void main(String arr[])... what if i replace public with private ........... remove
static ........replace void with string
[Link] hash map we have (key and value ) pair , can we store inside a value =(key, value ) again
??
5. what are variable scope in java (in class , in method , in static block)
6. what are the oops concept ? explain them each with real world examples
[Link] a program so that when ever u create a object ... u get to know how many object u
have created
8. what is singleton classes ?
[Link] is difference between .equals() , (==) and compare-to();
10. what is the difference between hash code and equals
[Link] a program to get substring of string ex: javais good ... so result : avais
[Link] a program to reverse the string
13. wap for binary search
[Link] is the use of package
15. why we use interface and abstract
[Link] have 2 interface both have print method , in my class i have implemented the print
method , how u wil get to know that i have implemented the first interface and how u will use
it .. if u want to use it
[Link] is the difference between vector list and arraylist
18. difference between hashmap and hash table, what is synchronization , how it is achieved
19. what is the use of collection, when we use it
20. what is priority queue in collection , what is the use , how u have use in your project
[Link] to use hashmap and hashtable
22. where u have use the concept of interface and abstract in your framework
23.

==============================================
SPAN Info tech
=============================================

Selenium question:

How to work with dynamic webtable ?


What is asserstion & types of asserstion ?
what to work with file attachment & file download in webdriver ?
How to file attachment with out Autoit scripts ?
how to work with weblist @ radio button in webdriver ?
what is the difference between the implicit wait & webdriver wait ?

Which repository you have used to store the test scripts ?


What is Check-in & check-out , revert ?
how to work with Radio buttun ?
how to work with weblist ?
what is the use of Actions class in webdriver?
how to work with keybord and mouse opration in java ?
how to get the text from the UI in runtime ?
expain the Architructure of Webdriver?
How to run the test scripts with mulitiple browser ?

Java Qustion

IN parent and child class i have disp() methode , using child class reference how to call
parent disp() methode ?
what is the use of this keyword
how many types execption avilable in java?

difference between final finaly , finalize?


difference between Overriding and overload ?
differebce between MAP & set ?

================================================
Mind tree interview Question
===================================================

Selenium
1. how to handle dynamic object
2. how to work with button which is in div tag and and u have to click without using xpath
3. JVM is dependent or independent platform

[Link] many Test script you write in day


5. describe your framework
6. how to parameterized your junit
[Link] to handle ssl security
8. how to handle window pops
9. diffnct between implicit and explicit
[Link] are the types of assertion and what are assertion in junit

Java
[Link] is dependent or independent platform
[Link] bw hashmap and hash set, set and linkedlist, arraylist and vector list , linkedhash set
and hashset
[Link] and interface
[Link] and throws
[Link] to split
[Link] and unchecked exception
[Link] to work with azax aplication
[Link] sring is immutable
[Link] is the retru ntype of getwindowhandles();
[Link] are the types of assertion and what are assertion in java

=================================================
Indicomm Interview Question
================================================

Interview Questions AltiMetrik

1 what is inheritence?Explain the use of inheritence?


2 what is abstract class?
3 what is interface?
4 when to use inheritence and when to use abstract class?
5 what happence if i not provide abstract method in abstract class

and interface?
6 what is method overriding java what is the use of method

overriding?
7 what is constructor ?use of constructor and can i ovverride the

costructor?
8 how to call the super class method in subclass?
9 what is the base class for all java class?tell me the methods?
10 what is hashcode method explain programtically(asked

implementaion of hashcode method)?


11 what is toString method ?what happens when i use in the program

explain?
12 what is String builder?
13 what is String tokenizer?
14 what is the difference between string and String Buffer?
15 what is the capacity of String Buffer?
16 what is collection ?
17 what is list?
18 what is Arraylist Expain?
19 Write logic for Array to Arraylist?
20 write logic for Arraylist to Array?
21 why vector class is defined Synchronized ?
22 what is exception ?
22 difference between Throw And Throws?
23 what is custom Exception explain?
24 What is finally block?Use of Finally block?explain
25 what happens if exception not found in try catch block?
Then finally block will be Excuted or not

Questions from Infinite


if u have multiple alerts, how do you handle it.
if you have two password/reneter password
assert equals/assert same
navigate() and switch to
one webdriver driver is opened, what to do to make addons to work
how to join two sets/answer: by using addon method....
what are all the collections you used

india/all states, need to select the last value of the dropdown list

=============================================
Software AG
=============================================

how to work with ajax application, flash, frame, log files,

log file will generated, for each action u do...ex: for gmail, compose mail;> there would be
some log generated....so how to capture that log...

if you have a .bat file, how do you call that...

what exactly you call for this..

how you will make sure that page has been loaded...

StarMark Interview Questions


1. Diff between static and non static
2. What is multiple inheritance
3. Write program for prime no.
[Link] to run [Link] through command prompt
5. Diff b/w overloading and overriding
6. how many wait methods you are using in webdriver
7. Difference between assertion and verification
8. What are the roles and responsibilities.
9. Why TestNG is better than JUNIT
================================================
HCL interview Questions:
===============================================
1. difference between string and string buffer?
2. difference between linked list and arraylist?
3. thread concepts?
4. why string class is immutable?
5. Singleton class?

==================================================
Adobe Interview Questions:
==================================================
1. Retrieve the test data from excel sheet, put in in google search bar, click on search button
and click on the first link opened in google search.
2. Write a program to check whether the string can be a palindrome. for example if the string
aab(it is not a palindrom string). replace the characters in a string like aba, baa etc. and check
that can be a palindrome string.
3. How will you Identify the webelement that has same property values?
4. write a pgm to return the [Link] rows and columns in a webtable?
5. Write a prm to return the row and colum value like(3,4) for a given data in web table?

interview question from companies(happest minds,emids and adobe)


1) how to create a folder in [Link]
2) describe about your framework.
3) difference between selenium rc and selenium webdriver
4) explain the architecture of your project
5) draw ur framework
6) write a code for fetching the data from excel sheet
7) write a code for palindrome
explain about jenkins
9) explain about ur control version tool
10) how to handle with drop down
11) how to handle window id
12) how to handle with google search text box
13) how to handle alert and window pop up
14) how u will get the frame id
15) how to handle dynamic webtable
16) why we are using follwing siblings
17) create a pagefactory for login page
18) how u will group,how u will add classes from different packages

====================================================
EBAY InterView Questions
====================================================
TESTNG QUESTIONS ASKED IN EBAY
1. What is the use of TestNG/Junit ?
2. What is parameterized testing?
3. How can u achieve parameterized testing using TestNG?
With the help of 2 annotations @Parameters and @Dataprovider.
4. Can you map test method names in XML file along with class names?
Yes, we can do it please see below ex:
<classes>
<class name="[Link]">
<methods>
<include name="testMethod" />
</methods>
</class>
</classes>

5. Sequence of execution of below annotations:


@Test
@BeforeGroups
@AfterGroups
@BeforeSuite
@AfterSuite
@BeforeMethod
@AfterMethod
@BeforeClass
@AfterClass

6. What is Yaml file?


TestNG supports YAML as an alternate way of specifying your suite [Link] might find the
YAML file format easier to read and to maintain. YAML files are also recognized by the
TestNG Eclipse plug-in.

7. How will you execute only selected test methods in particular Test class?
8. How do you fail test cases in TestNg?
9. Can we execute test cases parallely in TestNg?
10. How can we control the order of test method invocation?
We need to create Dependency.
TestNG allows you to specify dependencies either with annotations or in XML.:
You can use the attributes dependsOnMethods or dependsOnGroups, found on the @Test
annotation.
Alternatively, you can specify your group dependencies in the [Link] file. You use the
<dependencies> tag to achieve this:

11. How can you make sure test methods which are run in a certain order doesn't really
depend on the success of others ?
By adding "alwaysRun=true" in your @Test annotation.

================================================
ACCOLITE INTERVIEW QUESTIONS:
================================================

[Link] is the use of static keyword in Main()?


[Link] a class without main() gets compilation successful?
[Link] between abstract and interface.
[Link] of function overloading in Selenium Webdriver
[Link] we private access specifier inside interface?
[Link] there any way to deallocate memory in JAVA?
[Link] is the use of finalize method? whether implementation is already available.
[Link] do you handle drop down list box.
[Link] a pgm for removing white spaces in a String?
[Link] five critical testcases for the above written pgm.
[Link] is missing in Selenium Webdriver compared to Selenium RC?
[Link] have a parametrized constructor, whether it will call default constructor first? or
directly it will call parametrized contructor?
[Link] is the difference between Webdriver Wait(Explicit Wait) and Implicit wait?
[Link] a xpath using following-sibling?
[Link] will you analyze the failures after giving a run in the TestNG framework?
[Link] the Selenium Webdriver Architecture?
[Link] The framework you were using ?
[Link] is Object class?
[Link] Tool - Scheduled Batch Run - any idea
[Link] is the current version of Selenium Webdriver ? What are the other languages do
Selenium Support?
[Link] are you writing log files in your framework?Using Log4J Jars or any other methods.
[Link] to handle SSL certificate?
[Link] is the latest version of selenium webdriver?

All interview Qustions


=============================================
HeadStronginterview qustions
=============================================
[Link] framework
[Link] factory model code?diffrence between pagefactory and page object model?
[Link] is object reposiratory?
[Link] to overwrite a data in excel sheet?
[Link] different frame works.
[Link] are property files?
[Link] is done in testng xml.
[Link] to run tests in different browser.
[Link] to handle alerts.
[Link] connections?
[Link] to report ?
[Link] method for reverse a string?
[Link] faced?
[Link] s=”AABBBCFFDD” Count the presence of each letter.
15 pascle triangle program.
[Link] and interface difference?
17 interface and inheritance difference?
[Link] is polymorphism?
[Link] between string and string builder?
[Link] is static variable,
[Link] is null pointer exception .
[Link] are the exception you found?
[Link] lifecycle?
[Link] driver waits and implicit wait?
[Link] we write multiple CATCH in webdriver code?
[Link] we close the driver in try block then,FINALLY will execute or not?
[Link] are the different types of framework ?
[Link] we go for hybrid frame work?
[Link] between data driven and modular f/w?

============================================
Exlliant Interview qustions
===========================================

[Link] is testng?why we go for testng?


[Link] we run a test without testng?
[Link] is the difference between verification and valiation?
[Link] are the different locators in selenium?
[Link] is xpath?
[Link] between absolute and relative path?
[Link] is difference between abstract class and interface?
[Link] in diff between method overloading and constructor overloading?with example?
[Link] between string and string buffer?
[Link] is overriding ?
[Link] to handle dynamic elements?
[Link] to get the no of emp getting same salary?

===========================================
CalSoft labs interview qustions?
============================================

[Link] your framework?


[Link] to do grouping?with code?
[Link] to handle different pop ups?
[Link] between string and string buffer?
[Link] is difference between abstract class and interface?
[Link] between final,finaly,finalize?
[Link] between normal class and final class?
[Link] to handle frames without having any attributes?
[Link] between smoke and sanity testing?
[Link] process you follows?
[Link] design in java?

===================================================
Bosch interview Qustions
==================================================

[Link] a string without using inbuilt functions?


[Link] of numbers?
[Link] method for select dropdown?
[Link] code for fetching data from xl sheet?
[Link] is testNg?
[Link] is selenium grid?write the code?
[Link] to do parallel execution?
[Link] to handle ssl certification in ie?
[Link] to handle popup’s?
[Link] to fetch all the options in auto suggest?
[Link] to upload a file ?write the code?
[Link] to generate daily execution report?
[Link] frame work?
[Link] between junit and testng?

====================================================
Techmetric interview
====================================================
[Link] is webdriver?
[Link] all of abstract methods of webdriver are implemented?
[Link] to handle dynamics webelement?
[Link] to fetch data from excel sheet?
[Link] to write xpath,css?
[Link] to connect to the database?

Explain ur responsibility in ur project?


2. Explain ur project(team size,domain etc)
3. Automation process?
4. All basic questions on Manual Testing?
5. Diff between RC,IDE,GRID and Web Driver?
6. How to handle SSL issue,POP-Up alert?...

==================================================
HappiestMind interview questions
=================================================
[Link] is collection in java.
[Link] with any of the collections.
[Link] a letter in string?
[Link] a number?
5. sorting ana array?
6 .What is page object model?
7between css and xpath which one is faster?
[Link] is [Link] some exception.
[Link] some exception you get while writing code.
[Link] to handle exception ?
[Link] it agood approche to throw an exception?
[Link] to generate a report?
[Link] many testcase you have automated.
[Link] many test case you run in a batch execution?
[Link] is the minimum time to run a batch execution?
[Link] me complex secnarion of your application?
[Link] you faced in automation.
[Link] to upload file other than Autoit?
[Link] testcase for a pen?
[Link] to run a test 3times if the test fail ?

==========================================
NEss
==========================================
1. what is the diff between STRING and STRING BUFFER.
2. WAP For String Reverse.
3. Find how many duplicate values in Array List.
4. string [] str={"abc","efg","fgh"};
conver array to string.
5. about file downloading and uploading.
6. what is PageFactory explain.
7. explain method overloading and overriding .. how practically
implemented in ur project.
8. what are the challenges of SELENIUM.
9. explain the features of JAVA.
10. how do u say JAVA is platform independent.
11. is JVM platform independent.
12. write code for data fetch of excelSheet.
13. explain how do u access DB in selenium.
14. explain ANT and what are the pros and cons.
15. how do u achieve parallel execution in TestNG.
16. what is the dictionary meaning of SELENIUM.
17. accronomy of ANT and POI.

Explain ur responsibility in ur project?


2. Explain ur project(team size,domain etc)
3. Automation process?
4. All basic questions on Manual Testing?
5. Diff between RC,IDE,GRID and Web Driver?
6. How to handle SSL issue,POP-Up alert?...

=====================================================

You might also like