Automation Testing Interview Questions (Part - 2) | JAVA | 1+ YOE | @rdautomationlearning609

preview_player
Показать описание
1. What is Volatile variable in Java
volatile variable in Java is a special variable which is used to signal threads,
a compiler that this particular variables value are going to be updated by multiple threads inside Java application.
By making a variable volatile using the volatile keyword in Java, application programmer ensures that its value should always be read from main memory

2. Can we Override Private Method in Java?


No, you cannot override private methods in Java, private methods are non-virtual in Java and access differently than non-private one. Since method overriding can only be done on derived class and private methods are not accessible in a subclass, you just can not override them.

3. Fundamental difference between List and Set in Java
List in Java allows duplicates while Set doesn't allow any duplicate

List is an Ordered Collection while Set is an unordered Collection.

Set uses equals() method to check uniqueness of elements stored in Set, while SortedSet uses compareTo() method to implement natural sorting order of elements.

Q4. What is the difference between Absolute Path and Relative Path?
Absolute XPath starts from the root node and ends with desired descendant element’s node. It starts with top HTML node and ends with input node. It starts with a single forward slash(/) as shown below.

/html/body/div[3]/div[1]/form/table/tbody/tr[1]/td/input
1
/html/body/div[3]/div[1]/form/table/tbody/tr[1]/td/input

Relative XPath starts from any node in between the HTML page to the current element’s node(last node of the element). It starts with a double forward slash(//) as shown below.

Q5. What is the difference between setSpeed () and sleep () methods?
Both sleep() and setSpeed() are used to delay the execution speed.

setSpeed(): It set up speed that will apply a delay time before every Selenium operation.

Example: setSpeed(“5000”) – It waits for 5 seconds

sleep(): It set up wait only for once when called in our Selenium script.

Example: sleep(5000) – It waits for 5 seconds
Рекомендации по теме
Комментарии
Автор

Thanks for these videos which helped me a lot to get my dream job

DayanathKeerthidhana
Автор

I pray that rohini gets a job soon, she is putting in lot of effort.., , keep going Rohini

mallumanga
Автор

Sir, can you please tell us - *"What is the difference between Encapsulation and Abstraction"* ?

himanshukhare
Автор

Hi Sir,

I would like to take a mock interview with. could you pls kindly provide the email contact..! Thanking in advance

priyanarayanan