Selenium Interviews Questions
Selenium Interviews Questions
: It is involve physical execution of test cases scenarios against the application to detect the errors
and bugs
What Is Automation?
: Automation testing is the way to automate the testing process/manual testing to reduce human
efforts/errors and Time .
: Selenium Remove Control : Remove Control is a server written in Java that accepts commands for
the browser via HTTP . RC makes it possible to wrote automated test for a web application in any
programming language.
: Selenium Web Driver :Selenium web driver is the successor to selenium RC selenium web driver
accepts commands and selenium web drivers does not need a special servers to execute texts
instead the webdriver directly starts a browser instance and controls it.
Gride : Selenium Gride is a server that allows tests to use web browsers instance running on remote
machine with selenium gride one server act s the Hub
Difference Between
Webdriver/WebElement
WebDriver : In Webdriver we can perform the action on browser.
Methods –
1. get();
2. Set position();
3. Set size();
4. Maximize();
5. Get Title();
6. Get current URL();
7. Close();
8. Quite();
WebElement : in Webelement we can perform the action on element which is present in webpage.
Methods :
1. Is selected ();
2. Is displayed ();
3. Is enable ();
4. Sendkeys();
5. Click();
6. Clear();
7. Get Text();
Get();/Navigate();
Get(); :- In get(); method it is used to only open browser
Navigate(); :- In navigate(): method it is also used to open browser as well as it performs different
actions like :
Naviget.forward();
Naviget.backword();
Naviget.refresh();
Close();/Quit();
Close(); :- Close(); method is used to close the current TAB only
Driver.manage().window().maximize();
Radio.Click();
Is displayed();
Is enable();
Is selected(); - return type is Boolean
IsSelected(); - IsSelected(); method used to verify the web element is selected or not. Probable
used with radio buttons dropdowns and checkboxes.
IsDisplayed(); - This method check the presence of all kinds of web elements available
IsEnable(); - This method used to verify the Inpute type web element is enable or not
Click(); - By using Click(); method we can perform the action on radio button and checkbox.(Return
type of radio button is webelement)
GetText(); - By using getText(); method we can get the text from the webpage
SendKey(); - First we have to find the Xpath of that particular element then by using sendKeys();
method we can entry the value.
SelectByValue – Used to select the list option By using the specified Value. Store in String.
GetOptions(); - Return all options belongs to your select TAG. Find the value in sequence. E.g. We
have arrayin Java then array display the value from index 0 to end of array.
IsMultiple – Command is used to verify whether the specified select element support selecting
multiple options at the same time. It returns True when It support selecting multiple options else
return Fail
GetAllSelectedOptions – (List of Webelements) – Used to review all the list options that are
currently selected in the multi-selection Box field.
Implicit Waits – It will tell to webdriver to wait for a certain amount of a time before it throws the
No such element exception error
Explicit Wait – It applied only for specified elements. Time + condition + Parameters are used
Fluent Wait – It performs in the loopto stop the time. Time + condition + Frequency + parameters
are used
What are the popups? Types of Popups? How to Handle the alert popups and Child
browser Popups?
- Popups are the small and separate window which will display when you perform the action
on element which are present in webpage.
1. First we need to switch the selenium focus from main page to alert popup
Sytax – driver.switchToalert();
2. Alert Contains Abstract method like
- Accept(); – To click on Ok button
- Dismiss(); – To click on Cancel button
- GetText(); – Get text from alert popups
1. To handle the iframe we need to selenium focus from main page to iframe by wing –
driver.switchTo().frame(string,value,index)
2. Once action is perform on the component present in iframe will not navigate by defauld to
main page
3. To navigate from iframe to main page we need to use method like parent frame or default
contain – driver.switchTAo().defaultcontain();
1. Prioritty – To change the execution method we use priority, It bydefault 0 positive intefer
negative integer duplicate, Priority can’t be decimal or variables.
2. Envocation Count – Some time some method need to execute multiple time then we use
envocation Count.
3. Enabled – If test class can contain multiple method and we need to skip one of test method
execution we need to use enabled – Fales.
4. TimeOut – If test class contains multiple test methods to if one of the test method is time
consuming to execute the TestNG bydefault fail that test method nd execute other test
method withch can be using TimeOut keyword.
5. DependsOn – If one test method is depend on the another method then we need to use
dependOn keyword.
1. Act.moveToElement().perform();
2. Act.click.perform();
1. Key.arrow-up().perform();
2. Key.allow-down().perform;
3. Key.enter
Drag and drop function – present in action class with parameter source and destination.
What are the limitations of selenium and in which case we can not use the
selenium?
1. In selenium we can not upload and download the file
2. We can not automate the captcha
3. We can not automate the barcode
4. Ad-hoc test cases cant be automated
Advantages of TestNG ?
1. Ability to produce HTML reports of execulation
2. Annotations are available
3. Test cases can be grouped or prioritized more easily
4. Parallel testing possible
5. Generate log files
6. Execute fail test cases
POM – Project Object model is fundamental unit of work in mavan, it is an XML file that contains the
information about the project and configuration details.
What is Jenkins ?
- Jenkins is open source continues integration tool
- It is cross platform can be used as windows, Linur, mac, OS
- Jenkins main use is to schedule a particular job and moniter any job or application status
- It force pre-configured actions when a particular step occurs
Features –
Advantages of POM?
- It makes easy in maintaining the code
- Makes code readable
- The code becomes less and optimised
-These programs operate like any other browser, but do not display any UI