Altimetrik – Selenium Interview Questions
Here is the list of Selenium Interview Questions which are recently asked in Altimetrik company. These questions are included for both Freshers and Experienced professionals. Our Selenium Training has Answered all the below Questions.
1. What is Interface and Abstractclass?
The interface is defined by a blueprint that can be used to implement a class. The interface does not contain any concrete methods. All the methods of an interface are abstract methods.
A class which has the abstract keyword in its declaration is called abstract class. Abstract classes should have at least one abstract method. , i.e., methods without a body. It can have multiple concrete methods
2. String and Stringbuffer�
String | Stringbuffer |
---|---|
String is slow and consumes more memory when you concat too many strings because every time it creates new instance. | StringBuffer is fast and consumes less memory when you cannot strings. |
Methods are not synchronized | All methods are synchronized in this class |
String class is immutable. | StringBuffer class is mutable. |
3. string a =””; string a= “”;
4. Difference between jvm and jre
Jvm | jre |
---|---|
JVMs are available for many hardware and software platforms | JRE is an acronym for Java Runtime Environment. |
It is JVM which is responsible for converting Byte code to the machine specific code. | Along with Java binaries JRE also consist of various technologies of deployment, user interfaces to interact with code executed, some base libraries for different functionalities and language and util based libraries. |
5. Difference between hashset and hashtable.
Hashset | Hashtable |
---|---|
HashSet permits to have a single null value | It does not allow null for both key and value |
HashSet is not Synchronized but can be synchronized externally | HashTable is Synchronized. |
HashSet uses add method to insert into hashset | HashTable uses put method to insert into hashtable |
6. Difference between arraylist and array.
Arraylist | Array |
---|---|
ArrayList is dynamic in size. | Array is static in size. |
It is mandatory to provide the size of an array while initializing it directly or indirectly. | We can create an instance of ArrayList without specifying its size. Java creates ArrayList of default size. |
7. Use of set – collection
Collections in java is a framework that provides an architecture to store and manipulate the group of objects Collections. In java is a framework that provides an architecture to store and manipulate the group of objects
8. Method overloading and Method overriding
Method overloading | Method overriding |
---|---|
Method overloading is used to increase the readability of the program. | Method overriding is used to provide the specific implementation of the method that is already provided by its super class. |
Method overloading is performed within class. | Method overriding occurs in two classes that have IS-A (inheritance) relationship. |
9. Meaning of Polymorpism.
Polymorphism is considered one of the main features of OOPs. It allows us to perform a single action in different ways. In other words, polymorphism allows you to define one interface and have multiple implementations
10. Assert and Verify and WaitFor
Assert | Verify | WaitFor |
---|---|---|
The First Name text box is actually an element present in the Registration page of Mercury Tours, not in the homepage. | Selenium IDE indicates the position of an element by measuring (in pixels) how far it is from the left or top edge of the browser window. | These are commands that wait for a specified condition to become true before proceeding to the next command. |
We use the Assertion in the try catch block. Mostly, the assert command is used when the end result of the check value should pass to continue to the next step. | When the verifyTextPresent command was used on each of them, one passed while the other failed. | These are commands that wait for a specified condition to become true before proceeding to the next command |
11. What is the difference between “/” and “//” in Xpath?
/ | // |
---|---|
Single slash is used to create Xpath with absolute path i.e. the xpath would be created to start selection from the document node/start node. | Double slash is used to create Xpath with relative path i.e. the xpath would be created to start selection from anywhere within the document |
12. What are the different types of locators in Selenium?
Types are locators are,- ID
- Name
- ClassName
- TagName
- LinkText
- PartialText
- CSS
- Xpath
13. What is Selenium? What are the different Selenium components?
Selenium is an automation testing tool which is used to test web-based applications. Selenium is not a single tool but a suite of tools.Selenium Components:
- Selenium IDE (Integrated Development Environment).
- Selenium RC(Remote Control)
- Selenium WebDriver
- Selenium Grid
14. What are the limitations of Selenium?
- Open Source Forums
- No support for REST and SOAP Platforms
- No Reporting capability
- Image Testing
16. What is the difference between Assert and Verify?
Assert | Verify? |
---|---|
The false condition, the next text case of the suite will be executed. | In case of false condition, the next test step of the same text case will continue. |
There are two types of assets namely hard and soft asserts. | There are no categories for verification. |
Free PDF : Get our updated Selenium Course Content pdf
17. Meaning of super keyword
It is a reference variable that is used to refer parent class objects. Also, the keyword super came into the picture with the concept of Inheritance.
Whenever you create the instance of subclass, an instance of parent class is created implicitly which is referred by super reference variable.
18. Find links and Manipulation
Java for-each loop, findElements() & By.tagName("a") method.
String manipulation in Java is more easy with the set of methods it has and it is crucial for test automation,
19. Print data in IDE – echo
20. Is string immutable?
/*package whatever // do not write package name here */
import java.io.*;
class GFG {
public static void main(String[] args)
{
String s1 = "java";
s1.concat(" rules");
// Yes, s1 still refers to "java"
System.out.println("s1 refers to " + s1);
}
}
Output:
s1 refers to java
21. STLC life cycle
STLC Phases- Requirement Analysis
- Test Planning
- Test case development
- Test Environment setup
- Test Execution
- Test Cycle closure
22. If you are getting a showstopper a day before delivery what would you be doing?
23. What ways you can declare string?
The syntax of declare string is,
char str_name[size];
24. Use of javac and java.
Technically, javac is the program that translates Java code into bytecode (.class file) - an intermediate format which is understandable by the Java Virtual Machine (JVM).
And java is the program that starts the JVM, which in turn, loads the .class file, verifies the bytecode and executes it.
javac and java are the cornerstones of the Java programming language. All editors or IDEs rely on these tools for compiling and executing Java applications.
25. Have you use data structures in your project?
26. How do you rate yourself in java and webdriver?
Explain your experience and skills set and then rate yourself at out of 10.
27. What is Selenese?
Selenese is the set of selenium commands which are used to test your web application. Tester can test the broken links, existence of some object on the UI, Ajax functionality, Alerts, window, list options and lot more using selenese.
28. Which is the package which is to be imported while working with WebDriver?
org.openqa.selenium is the package which is to be imported while working with the WebDriver.
29. How to get the number of frames on a page?
Please follow the below two steps to get the frames on a page.
With the help of List
With the help of a Javascript executor.
30. How to check if a button is enabled on the page?
Selenium Webdriver is an open-source collection of APIs which is used for testing web applications . Selenium web driver provides one method called - isEnabled which can be used to check if the button is enabled or disabled in Selenium Webdriver in Java.
31. How to get the title of the page?
The following method can be used to get the title of the page, wd.get("http://www.abcd.com/");
at = wd.getTitle();
System.out.println(at);
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.