0% found this document useful (0 votes)
25 views

Selenium Interviews Questions

Uploaded by

riteshawachat5
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views

Selenium Interviews Questions

Uploaded by

riteshawachat5
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

 What is Manual Testing?

: 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 .

 What is the Selenium?


: Selenium is the open source automated testing tool where with the help of selenium we can test
web applications across variable browsers.

 What are the Selenium Components ?


: Selenium IDE : Selenium Integrated development environment is the major tool in the selenium
suit. It is complete integrated development environment for selenium tests.

: 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

 How to Open a Browser?


We can open a browser by using :

driver.get(“URL”) OR driver.navigate to (“URL”)

 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

Quit(); :- quit(); method is used to close the all Tabs

 How to Maximize Browser?


By using maximize(); method we can maximize the browser.

Driver.manage().window().maximize();

 Can you Minimize the browser?


No! we can not minimize the browser.

 How to select Radio button/CheckBox?


By using Click(); method we can perform the action on radio button and checkbox.(Return type of
radio button is webelement)
Webelement Radio = driver.findelement by Xpath

Radio.Click();

To perform different action :

 Is displayed();
 Is enable();
 Is selected(); - return type is Boolean

 How to take/get present text from the webpage?


: By using getText(); method we can get the text from the webpage.

 How to get a page Title?


: By Using getTitle(); method we can get page title.

 How to Enter the Value in inpute field?


: First we have to find the Xpath of that particular element then by using sendKeys(); method we can
entry the value.

 What is isSelected/ IsDisplayed/ IsEnable/ FindElement/ GetWindowHandle/


GetWindowHandles/ SendKey/ GetText/ Click/GetSize and SetPossition?

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.

Setposition(); - Used to srt position of browser

 Functions of ListBox – SelectByIndex/ SelectByValue/ SelectByVisibleText/


GetOptions/ IsMultiple and GetAllSelectedOptions
SelectByIndex – Used to select the list option By using the specified index number. Index start with
0.

SelectByValue – Used to select the list option By using the specified Value. Store in String.

SelectByVisibleText – Used to select the list option from dropdown options/field.

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.

 How to Handle Customized List Box?


Handle customized list box by using action and Key class. Action a = new action();

 Is there any alternate way to sendKey(); and Click(); method?


- For sendKey(); alternate method is Javascript
- For Click alternate method is Submit();

 Difference Types of Waits in Selenium?


- Three types of Waits :

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.

Types of Pop Ups –


1. Hidden Division Popup
2. Alert Popup
3. Child Browser Popup
4. Authentication Popup
5. File Upload
6. File Download.

Handle Alert Popup –


- We can not inspect element present in popups
- Drag and Drop action can perform
- This popup will contain Ok/ Cancel/ and Text.
- Also contains (?) and (!) symbol

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

Handle Child Browser Popups –


- We can perform Inspect and Drag + Drop both options
- This popups will contains address field, maximize, minimize and Close Option
- To Handle first we need to switch the selenium focus from main page to child browser page
- Syntax – switchTo.window(string ID);
- If multiple child browser displayed then to handle the child browser popup we need to
identify address field or ID or ID’s which is Unique
- Syntax – set(string)Ids = driver.getwindows();
- Steing id = ids.get(index 2);

 Write a code for ScreenShot ?


- Driver.get(www.google.com)
- File source = (Takescreenshot)driver.getscreenshot AS (outfile.file);
- File destination = new file (Path of folder);
- FileHandle.copy(Source, destination);
-
 How to Fetch Data from Excel ?
- First configure the acache POI Jar file in our project
- Create an excel sheet with same data and store it anywhere in any drove
- Create an object of input stream class with the external sheet path as input
- Fileinputstream(class) file(Object) = new fileinputstream(“Path”)(external path);
- To open the excel sheet we need to use static method which is present inside the work book
factory class.
- String value = workbookfactory(Class).create(file).getsheet
- (Sheet 1-{excel sheet name}).getrow(0).getcell(0).getstringcellvalue();
- Syso(value);
 To Open the specific sheet we need to getsheet(); method
 To identify row we need to use getrow(); method();
 To identify cell we need to use getcell(); method();
 To fetch string value we need to use the getstringcellvalue(); method
 To fetch the numeric value we use getnumericcellvalue(); method
 How to Handle the Iframe?
- Displaying the webpage as the part of another webpage called iframe

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();

 Different Annotations and KeyWords ?


1. Before Class – Used for executions of few test methods before execution test class
2. After Class – Used for execution of few test methods after executions of test class
3. Before Method – Used for execution of few test methods before executions every test
method
4. After Method – Used for execution of few test methods after executions every test
methods.
5. Test – used for execution of test method or test case.
6.

Different Kayword for annotations –

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.

Which Framework you currently working?

- Data driven framework

 Role and Responciblities of test engineer ?


- Find the locators
- Developing POM class
- Envolve In excecution
- Sending the reports
-
 What are the different Xpath Functions ?
1. Contains();
2. Start With();
3. Text();
 Action and Key class in Selenium?
- Action Class - Ability to handle various tyupe of keywords operations like drag + drop or clicking on
multiple elements

Different Function in action class –

1. Act.moveToElement().perform();
2. Act.click.perform();

Different Function for Kay class –

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

 Have you created any framework?


- No, I didn’t get a chance to involve in it.

 What is Mevan? What is POM XML?


- Mevan is project Management tool,Mavan is used to manage dependences (Maintain right version
of Jar’s)

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 –

1. It generate a list of all changes done in the repository


2. Can be configure to email
3. We can save test report and execution history
4. Jenkins supports mavan for building and testing a project in C1

 How to execute Fain test cases?


- After run the test project click on refresh
- A folder will be generated named Test Output folder, inside Test Output filder you could find
testing failed.
- Run testing failed XML to execute the failed test cases again.

 How to generate the report in your framework?


- After execution of test script simple refresh the project it will automatically create the output
folder and generate the report in it

 What is testing Listeners?


- It is an interface, It is used to customise testing reports.

 Different Types of exceptions in selenium?


1. Webdriver Exception – UTR in not proper way
2. Unreachable Browser Exception – When we inerupt the browser while running the text
script we will get unreachable exception.
3. Unhandled Alert Exception – Alert popup display and perform the action on browser.
4. No alert present Exception – Witout alert pop up we perform on other popup.
5. Unexpected Tagname exception –
6. No connected Exception – When selenium Jar file on able to connect with browser then we
will get not connected Exception
7. Unsupported operation Exception –
8. No Such Element Exception – When HTML code wrong to identify element/ because of
synchronization.

 What is Object Repository?


- Used to store element locator value in centralized location instead of hard coding them within the
script. We do create a property file to share all the element locators and these property file act as an
object repository in selenium web driver.

 Advantages of POM?
- It makes easy in maintaining the code
- Makes code readable
- The code becomes less and optimised

 Difference between soft assert and hard assert ?


1. Soft assert – to over come the drawback of assert class we need to use soft assert. Soft
assert collects errors during @ test . does not throw an exception when assert fail
2. Hard assert- to reduce the length of test scrip we use hard assert

 Where do you store your test data ?


-Excel sheet

 Where do you store your login credentials?


- Property file

 What is headless browser?


-Headless browser is a browser simulation program that does not have a user interface

-These programs operate like any other browser, but do not display any UI

 Latest versions of selenium ?


1. Chrome- 76.03809
2. JIRA- 9.8
3. HPALM-12.55
4. Selenium web driver- 3.14
5. SQL server- 2014
6. SOAP UI- 2.8.2
7. JAVA- 11.0.2

You might also like