Skip to content
Home » Automation Testing – Selenium Interview Questions With Java (Part-1)

Automation Testing – Selenium Interview Questions With Java (Part-1)

Below are the few commonly asked interview question for Selenium Java:

General Questions on Selenium Automation Testing Interview:

Tell me about yourself?

This is the most commonly asked question on almost all interviews, where you can say about your technical experience and the project you have worked and the domain knowledge you have and the testing tools you have worked.

What are your Role and Responsibilities?

Explain your roles current projects testing roles and responsibilities, starting from getting a requirement and the phases of testing were you are involved and automation script development, execution, reporting and defect tracking.

Automation Architecture of your current application?

This will be explained in separate post.

Which Automation framework you are using in your organization can you tell me the folder structure and flow of your framework?

This will be explained in separate post.

Java Selenium questions for interview:

Why String is immutable in Java?

Assume you create a string variable str1, when this string is getting created inside the heap memory we have string pool, where your value will be stored as object. And then if you try to create a new string str2 with same value “RefreshScience”, str2 will get pointed to existing object. It won’t create another new object. JVM will check if the object exists, if it is not then it creates new object.

String str1 = “RefreshScience”; //object (101)
String str2 = “RefreshScience”; //object (101)
str1 points to object1, str2 also points to object1.

If any new value is assigned to str1, a new object will be created and the value of str2 still points to existing object.

str1 = “”; //object (103)

What is static in java?

Static keyword in java is used for memory management. We can declare method and variable as static.

Static method:
1. If a method is defined as static in java, it means we need not create any object to call that method. Method can be called directly, with the class name.
2. Static Method cannot call non static method directly.
3. Static Method cannot use non static variable.

Static Variable:
1. Static variable can be considered as global variable.
2. Memory for static variable gets assigned during class loading.

What is Static block In Java?

It’s a static block where we can have variables or statements which need to be executed before the main function.

What is final keyword in java?

Final Keyword in java is used to make the variable always constant. Value cannot be changed throughout the execution.

What is this keyword in java?

This keyword in java is used to refer the current object inside a method or a constructor. We might have same variable names inside a class, using ‘this’ keyword we can refer the current method’s variable.

What is finally and where do we use it?

Finally is used in Java exceptional handling when we use try/catch block. Finally block gets executed even if there is exception in code. Mostly finally block is used to clean the code post execution or closing the existing connections.

Download the selenium java questions part-1 content as pdf:

More Questions and Answers will be updated in the Part-2 thread shortly. Kindly follow us, thank you for visiting.

Follow by Email