Real Time Automation Interview Questions - Part 2
In continuation with the latest series of Real Time Automation Interview Questions, we present you the part 2 of the course structure.
Real Time Automation Interview Questions - Part 1
- What do you mean by wrapper class and how will you do data conversion?
Wrapper class in java are used for data conversion. In data
conversion if user wants to convert Int to string, String to int,
Boolean, double then we use Wrapper class.
Integer.parseInt(); -To convert string to Integer
Double.parseDouble(); -To convert string to Double
Boolean.parseBoolean(); -To convert string to Boolean
String.valueof(); -To convert Integer to String
- Can you convert String = "110a" in integer?
No we got NumberFormatException while converting
the above string.
- What do you mean by Call by Value and call by Reference in Java?
- Call by value means suppose we have created one
sum method with input parameter int a, int b. So
while calling the creating the object and running we
provide values that is know as call by value. - What do you mean by Exceptions in Java?
- Exception is like any interruption in our normal flow.
Like if we are running anything and we got issues in
our script this is we called exception,
we have 2 types of exception Run Time & Compile
Time.(checked & Unchecked exceptions) - Can you tell me the difference between Throw and throws keyword?
Throw is a keyword used inside a body of function. And Throws used while
initializing any method. By using Throw we can throw only one exception
while for Throws we can declare multiple exceptions which might occur in
that particular function.
Java throw keyword is used to explicitly throw an exception.
Java throws keyword is used to declare an exception..
For More :
https://www.javatpoint.com/difference-between-throw-and-throws-in-java
- How much you rate yourself in Selenium out of 5?
- 3.5
- Which locator you are using in your framework and why?
Mostly we used ID and Xpath because Id is the
fastest and unique one and after that we prefer
Xpath. Anyways we have other locators as well like
css, class name, tag name, Link text, Partial Link
text.
- What is the difference between findelement and findelements?
findelement will give the first appearance of that element
which matches our locator, whereas findelements will
give us list of all the elements which is present over the
webpage and matching our locator.
And if we don’t find the element findelement will give us
nosuchelementexception whereas findelements will
return NULL/Empty list.
- Can you tell me how will you handle multiple windows in Selenium?
We have windowhandle & windowhandles function for
handling Multiple windows. Windowhandle will give the
string value of only the active window that is open
whereas windowhandles will give set of all the windows
that are open in browser.
For More :
https://www.browserstack.com/guide/handle-multiple-win
dows-in-selenium
Comments
Post a Comment