You are on page 1of 6

SELENIUM

Scenario: -

Sarah as an automation engineer onboards on a health care project end-


2-end test automation for the web application “All is Well” selenium using
java stood as the approval by the client for performing web UI
automation and TestNG for designing the testing framework. Sarah and
her team must start the project work from scratch to complete this testing
phase. Sarah and her team in liaison with client policies had decided to
go with the implementation of test automation for their web application.
The current project uses maven to build, selenium to automate the
interaction of web UI, TestNG to design test classes and methods
GIT/Inner Source codes to manage source to codes, extent reports to
generate rich HTML reports with a dashboard view and Jenkins to
continuously test the application.

1. Sarah desires to execute the below given code, wherein all the Assert statements
must be executed and validated even if one of the Assert statements is failed.
Ans: Option B (SoftAssert Assert = new SoftAssert(); // place missing code in the line no.
11
Assert.assertAll(); // place missing code in line no. 18 )
verified

2. Sarah completed the creation of the Maven project in Eclipse, with all desired
dependencies and plugin configured in the pom.xml file. She has now started
designing the TestNG class as shown below.
Ans: All option are correct

3. Sarah has created a maven project in eclipse, and trying to add required
dependencies like selenium, testing in pom.xml file. Suggest her with the right
approach of adding dependencies in the pom.xml file from the bel ow options.
Ans: option D
4. Sarah must generate a stunning HTML report with a dashboard along with
screenshots of the page whenever there is a failure in the test automation. She
used the extent API java library for creating the HTML reports.
Ans: ( A-2 B-3 C-1 ) verified

5. Sarah must automate and test the selection of a specific drug from a drop-down box
based on the selection of disease from another drop-down ..... The developers
designed
the UI in such a way that only ............. the drug data is feteched from the server based
on
a search query there can be some delay in response on the page.
Ans: option C ( line no. 6 ------ webdriverwait wait =new WebDriverWait(driver.duration.
verified
ofSeconds(10)); )
6. Sarah needs to automate and test a scenario for performing data-driven testing. She
is using some sensitive data like passwords, cvv as test data in her scripts.
Ans: option C ( 5 lines code option)

verified

7. Sarah must automate and test the selection of language preferences to the patients
(users) to support localization. She wants to select Hindi from the given language
preferences to test the navigation of the page. Assist her with all the possible
locator selections to select the desired language.
Ans: option a, b, c
verified

8. Sarah must automate and test the input box which is the iframe area. After
entering the input value in the input box now she wants to click on the home page
link. The developers designed the UI code shown below.
Ans: option B
verified

9. Sarah must automate and test a scenario where she needs to explore more on
drug names by category. Hovering mouse over a web element labeled as “drug by
category” will only display the list of choices by category, else the category items
from the list are hidden and not identifiable. The developers designed the UI code
as shown below.
Ans: option D verified

10. Sarah has created a maven project in eclipse with all desired dependencies like
selenium and testing in the pom.xml file. Now, she must configure plugins in the
pom.xml file to execute the tests from an external environment like maven or Jenkins.
Ans: option C verified

You might also like