T12 Se

Download as pdf or txt
Download as pdf or txt
You are on page 1of 11

Q1.

Alex, a seasoned automation tester working in a fast-paced software development company, is


testing a web application and is excited to explore different automation testing tools to make his job
more efficient. Alex wants to test a mobile application that runs on both Android and iOS platforms.
Which automation testing tool helps him do so?

Options :

1. Junit

2. Cucumber

3. Appium

4. TestNG

Q2.You are working on a project and you have the following YAML file: some : yaml What is
the JSON equivalent of that?

Options :

1. YAML cannot be converted to JSON

2. The given YAML is not valid

3. {"some" : "yaml"}

4. {"yaml" : "some"}

Q3.Peter is the lead software tester at a technology company overseeing the testing of a complex
web application that the company is developing. This web application is expected to undergo
significant changes and enhancements over the next two years due to evolving requirements and
continuous improvements. Why should Peter choose automation testing over manual testing for this
project?

Options :

1. The testing team lacks the expertise needed to implement automation testing.

2. The web application’s user interface changes frequently.

3. The tests have to be executed repeatedly over a long period.

4. The complexity of the web application requires an in-depth understanding of the


application's functionality.

Q4.The use of assertion is utilised to determine whether or not the predicted result and the actual
outcome match. Out of available choices, which in the Selenium IDE is NOT a type of assertion?

Options :

1. WaitFor

2. Wait

3. Assert
4. Verify

Q5.For access to the "TEST" website, John wishes to create a new account on the homepage. Choose
the appropriate option from the following list to represent the steps he should write in Gherkin.

Options :

1. GIVEN John is on TEST Registration page WHEN he enters all the required
registration information AND he hits ‘join now’ THEN his TEST account is created
AND he is directed to the profile creation page AND his confirmation email is
sent

2. Feature : User successfully creates a "TEST"Account GIVEN: John is on TEST


Registration page WHEN he enters all the required registration information AND
he hits ‘join now’ THEN his TEST account is created AND he is directed to the
profile creation page AND his confirmation email is sent

3. Scenario 1: User successfully creates a "TEST"Account AND John is on TEST


Registration page AND he enters all the required registration information THEN
he hits ‘join now’ THEN his TEST account is created WHEN he is directed to the
profile creation page GIVEN his confirmation email is sent

4. Scenario 1: User successfully creates a "TEST"Account GIVEN John is on TEST


Registration page WHEN he enters all the required registration information
AND he hits ‘join now’ THEN his TEST account is created AND he is directed to
the profile creation page AND his confirmation email is sent

Q6.There is a text field with the element ID "TRY," and the value we must enter is "GAME." Find the
appropriate JavaScript function that was utilised to enter the text into the TextBox.

Options :

1. document.getElementById(‘what’).setText(‘Selenium’)

2. document.getElementById(‘what’).setAttribute( ‘Selenium’)

3. document.getElementById(‘what’).setValue(‘Selenium’)

4. document.getElementById(‘what’).setAttribute(‘value’,’Selenium’)

Q7.Working on Open API 2 and Open API 3 is what you do. Which of these changes from Open API 2
to Open API 3 is not a significant one

Options :

1. securityDefinitions were renamed to securitySchemes

2. type: basic was replaced with type: http and scheme: basic.

3. API keys can now be sent in: cookie.


4. Removed support for OpenID Connect Discovery (type: openIdConnect).

Q8.You have completed one of your project and you are performing automation testing so that the
issues can be found and resolved. Identify the advanced framework design that can be used with
cucumber.

Options :

1. Page Object Model, Log4j , Extent Reporting , Dependency Injection ,Object


Repository

2. High Sierra, Sierra, El Capitan,

3. Behaviour data driven, test data driven, Hybrid

4. Catalina, Big Sur, and Mojave:

Q9.You are working on a project and while testing you have introduced YML file.In the context of
YAML, what does this denote - %?

Options :

1. Directive

2. Comment

3. Starting of a flow mapping

4. Starting of a flow sequence

Q10.Suppose the Web API provides an HTTP response with an error. Then, what is the appropriate
status code for the uncaught exception from the list of alternatives below?

Options :

1. 204- No Content

2. 403- Forbidden

3. 404 - Not Found

4. 500 -Internal Server Error

Q11.Daniel is writing a test case that involves adding a product to the shopping cart. After clicking
the "Add to Cart" button, a success message is displayed, and the cart icon in the header is updated
with the correct item count. However, due to the dynamic nature of the application, there is a slight
delay before the success message appears and the item count is updated. To handle this delay, Daniel
decided to use wait commands. What is the best approach for implementing wait commands in this
scenario?

Options :
1. Use a static wait of 5 seconds after clicking the "Add to Cart" button and then
assert the success message and item count.

2. Use the implicit wait feature provided by Selenium with a timeout of 10 seconds
and then assert the success message and item count.

3. Use the explicit wait feature provided by Selenium with a wait condition that
checks for the presence of the success message and item count.

4. Use a combination of implicit and explicit waits with a timeout of 5 seconds for
each, and then assert the success message and item count.

Q12.You are working on a project and you are provided with the below code snippet. What will be
the YAML equivalent for: Hello World?

Options :

1. yaml.load(''' - Hello - World ''')

2. yaml.load(Hello World)

3. yaml.print(''' - Hello - World ''')

4. yaml.print(Hello World)

Q13.Jacob is an automation tester working on a project that requires frequent and complex updates.
His manager asks him to automate the testing process for a newly added functionality to the e-
commerce application. This feature allows customers to purchase gift cards of different
denominations. Jacob must validate that the correct denomination is selected, added to the cart, and
the correct price is displayed at checkout. He decides to use Selenium WebDriver for automation
testing. Which approach is the most suitable to automate this functionality?

Options :

1. Use the XPath of the 'Add to Cart' button for every denomination and hard code
the expected prices in the code.

2. Use the CSS Selector for different denominations, add to the cart, and use a
data-driven approach to validate the prices at checkout.

3. Use the Link Text locator to select the denomination, add it to the cart, and
compare the actual price with hardcoded expected prices.

4. Randomly choose any locator strategy, add gift cards to the cart, and rely on
visual testing to validate prices.

Q14.3 of Swagger's primary products are described in the following 3 sentences: 1. A browser-based
editor where OpenAPI specifications can be written. 2 produces client libraries for our API in more
than 40 different languages. 3 produces interactive API documentation. Select the response that
correctly identifies the three products and their respective orders.

Options :

1. 1-Swagger Editor 2-Swagger Codegen 3-Swagger Codegen

2. 1-Swagger Editor 2-Swagger UI 3-Swagger Codegen

3. 1-Swagger UI 2-Swagger Codegen 3-Swagger Editor

4. 1-Swagger Editor 2-Swagger Codegen 3-Swagger UI

Q15.John, an experienced automation tester, is working on a project to automate the testing of a


web application using Selenium. The application belongs to a financial institution that provides
banking services to its customers. John is identifying the domains within the banking application that
can benefit the most from automation testing. Which domain(s) benefits the most from automation
testing using Selenium here?

Options :

1. Account Creation and Onboarding: Automating the account creation and


onboarding processes can help ensure that new customers can easily sign up,
provide the required information, and start using the banking services.

2. Fund Transfers and Payments: Automating the fund transfer and payment
functionalities can help verify that customers can transfer money between
accounts, make payments, and ensure the accuracy of transaction records.

3. Customer Complaint Management: Automating the customer complaint


management process can help ensure that customer complaints are handled
efficiently, promptly, and in accordance with the bank's policies and regulations.

4. Regulatory Compliance and Reporting: Automating the regulatory compliance


and reporting processes can help ensure that the bank complies with legal and
regulatory requirements, generates accurate reports, and performs necessary
audits.

Q16.During his Web application testing, Nick encountered a scenario where he must handle an alert
box that appears after clicking a button on a webpage. The alert box contains a message and two
buttons, "OK" and "Cancel." He must automate the handling of this alert box using Selenium. Which
approach should Nick take to handle this alert box effectively?

Options :

1. Use the Alert class provided by Selenium to switch to the alert, accept the
alert, and validate the message displayed. Additionally, handle any exceptions
that may occur during the alert handling process.
2. Use the driver.switchTo().alert() method provided by Selenium to switch to the
alert, dismiss the alert, and capture the text displayed. Verify the captured text
with the expected message to ensure proper alert handling.

3. Implement a custom alert handling mechanism using JavaScriptExecutor to


interact with the alert box. Use the executeScript() method provided by
Selenium to execute JavaScript code and simulate user actions on the alert box.

4. Utilize the Actions class provided by Selenium to move the mouse pointer to the
"OK" button on the alert box and perform a click action. Then, retrieve the
message displayed in the alert and verify it against the expected message for
alert handling validation.

Q17.Choose the appropriate list of Cucumber jar files to download in order to install the Selenium
Cucumber Framework.

Options :

1. cucumber-core cucumber-java cucumber-junit Selenium-jvm-deps cucumber-


reporting gherkin junit mockito-all cobertura

2. POIFS-core HSSF-java XSSF-java HPSF-all HWPF-junit XWPF-deps HDGF-junit


XWPP-all HPBF-core

3. cucumber-core cucumber-java cucumber-junit cucumber-jvm-deps cucumber-


reporting gherkin junit mockito-all cobertura

4. No jars were required to download. It already exist with in the IDE

Q18.In a Selenium test scenario, Sam opened a browser window and navigated to a webpage. Now,
he must click on a link that opens a new window and perform some actions on the newly opened
window. Which approach should he take to handle this situation effectively?

Options :

1. Use the getWindowHandle() method to get the current window handle, switch
to the new window using switchTo().window(), and then perform the required
actions.

2. Use the getWindowHandles() method to get all the window handles, switch to
the last window handle in the list, and then perform the required actions.

3. Use the getWindowHandles() method to get all the window handles, switch to
the first window handle in the list, and then perform the required actions.

4. Use the getWindowHandle() method to get the current window handle, open a
new instance of the browser, and perform the required actions on the new
browser instance.
Q19.Convert the following excerpt to JSON and think about a block chomping scenario: %YAML 1.2 --
- !!map { ? !!str "strip" : !!str "# text", ? !!str "clip" : !!str "# text\n", ? !!str "keep" : !!str "# text\n", }

Options :

1. { "strip": "# text", "clip": "# text\n", "keep": "# text\n" }

2. { "strip": "text", "clip": "text\n", "keep": "text\n" }

3. { "strip": "text", "clip": "text", "keep": "text\n" }

4. { "strip": "# text", "clip": "# text", "keep": "# text" }

Q20.Pam is the lead QA in an IT firm handling a project that involves creating automated tests for a
complex web application. After assessing the complexity and volume of the tasks, she decided to
follow the Automation Testing Life Cycle process for effective test automation. She completed Phase
1 (Test Planning & Design) and Phase 2 (Test Development) successfully. Pam is now in Phase 3 (Test
Execution phase) and chooses Selenium as her testing tool. While running the tests, she notices that
one of the test scripts is failing consistently. Upon investigating the issue, she realized it is not due to
a bug in the application, but due to an issue with the script itself. The script is failing to identify a
specific web element. What should be Pam's next step in this situation

Options :

1. Skip the test case and move on to the next phase.

2. Report this as a bug in the application.

3. Modify the script to fix the issue and re-run the tests.

4. Halt the testing process and go back to Phase 1.

Q21.Alex is automating a login functionality for his web application using Selenium. The login process
involves entering the username and password, followed by clicking the "Login" button. However,
after entering the credentials and clicking the button, the application takes an unpredictable amount
of time to load the user dashboard. Which wait command can help him troubleshoot this issue and
ensure the successful completion of the test case?

Options :

1. implicitlyWait

2. pageLoadTimeout

3. setScriptTimeout

4. FluentWait

Q22.Alex, a seasoned software developer working at a leading tech company, is developing and
maintaining a complex web application used by thousands of users worldwide. The company is keen
on adopting automation testing to improve the efficiency and reliability of its testing processes. He
successfully implemented automation testing for the web application. Which statement accurately
describes the impact of increased test coverage through automation?

Options :

1. It reduces the need for bug tracking and reporting.

2. It ensures 100% bug-free software.

3. It improves the overall quality of the software.

4. It eliminates the need for manual testing altogether.

Q23.Bob is on the main page of his application when he clicks on a link that opens a new window. In
the new window, he performs some actions and then closes it. After closing the new window, he
must switch back to the main window and continue his automation tasks. Which technique should
Bob use to handle this scenario effectively?

Options :

1. Window Handles

2. Window Titles

3. Window Index

4. Window URLs

Q24.The software development team of an MNC is using manual testing for their web application.
However, they noticed several bugs were missed in the last production release. To improve the
accuracy of their tests, they consider adopting automation testing using Selenium. What is the
primary benefit of this transition?

Options :

1. Automation testing will completely eliminate the need for manual testing.

2. Selenium will directly communicate with the application's database to identify


any underlying data issues.

3. Automation testing with Selenium will help identify performance issues in the
network.

4. Selenium can execute repetitive test cases accurately, thus reducing the risk of
human errors in testing.

Q25.Sandra is automating a registration process for a web application using Selenium WebDriver.
During the registration process, there is a step where the user must enter a verification code
received via email. However, there is a delay in receiving the verification email, and she wants to wait
for a maximum of 60 seconds for the email to arrive before proceeding to the next step. Which wait
command in Selenium helps her do that?
Options :

1. Implicit Wait

2. Explicit Wait

3. Fluent Wait

4. Thread.sleep()

Q26.A team of software testers is working on a large project that requires frequent and repetitive
testing. Due to time constraints and the repetitive nature of the work, the team is considering using
automation testing. Why would automation testing be preferred here?

Options :

1. It is not suitable for handling complex test scenarios.

2. It guarantees that the software is 100% bug-free.

3. It helps save time and reduce the workload on repetitive tasks.

4. It replaces the need for human testers completely.

Q27.When searching for an element in Selenium, developers can use either an Xpath or a CSS
selector. What makes one of the two better, and why?

Options :

1. Both css selector and xpath have similar performance , and usage will depend on
programer choice

2. Both have performance issue

3. CSS selector is better than XPath due to its simplicity, speed and performance

4. Xpath is prefered over css selector due to its simplicity , speed and performance

Q28."Consider the given scenario: A QA professional uses frameworks and is using multiple data set
parameters in order to reduce the cost of adding new tests whenever there are changes in the
business rules: Which framework is the QA professional using? Select the correct answer from the
choices listed.

Options :

1. Key Driven Testing Framework

2. Modular Testing Framework

3. Linear Scripting Framework

4. Data Driven Framework


Q29.Write a code to do the following: 1. Find the radio button in the html 2. Find the radio button
text and print

Options :

1. 1. public class Class1{ public static void main(String[] args) {


System.setProperty("webdriver.chrome.driver", "pathto/chromedriver.exe");
WebDriver d = new ChromeDriver(); d.manage().window().maximize();
d.findElement("URLpathto/abc.html"); d.findElement(By.id("yes")).click();
d.findElement(By.id("radiocheck")).click(); }} 2. public static void main(String[]
args) { System.setProperty("webdriver.chrome.driver",
"pathto/chromedriver.exe"); WebDriver d = new ChromeDriver();
d.findElement("URLPathtot/abc.html"); List<WebElement> e=
d.findElements(By.Tagname("radioname")); // Total elements : e.size()); for (int
m=1; m<=e.size();m++){ System.out.println("Text:" +
e.get(m).getAttribute("value")); } } }

2. 1. public class Class1{ public static void main(String[] args) {


System.setProperty("webdriver.chrome.driver", "pathto/chromedriver.exe");
WebDriver d = new ChromeDriver(); d.manage().window().maximize();
d.get("URLpathto/abc.html"); d.findElement(By.Name("yes")).click();
d.findElement(By.Name("radiocheck")).click(); }} 2. public static void
main(String[] args) { System.setProperty("webdriver.chrome.driver",
"pathto/chromedriver.exe"); WebDriver d = new ChromeDriver();
d.get("URLPathtot/abc.html"); List<WebElement> e=
d.findElements(By.Tagname("radioname")); // Total elements : e.size()); for (int
m=1; m<=e.size();m++){ System.out.println("Text:" + e.get(m).getValue("value"));
}}}

3. 1. public class Class1{ public static void main(String[] args) {


System.setProperty("webdriver.chrome.driver", "pathto/chromedriver.exe");
WebDriver d = new ChromeDriver(); d.manage().window().maximize();
d.get("URLpathto/abc.html"); d.findElement(By.id("yes"));
d.findElement(By.id("radiocheck")); }} 2. public static void main(String[] args) {
System.setProperty("webdriver.chrome.driver", "pathto/chromedriver.exe");
WebDriver d = new ChromeDriver(); d.get("URLPathtot/abc.html");
List<WebElement> e= d.findElements(By.name("radioname")); // Total elements
: e.size()); for (int m=1; m<=e.size();m++){ System.out.println("Text:" +
e.getAttribute("value")); } } }

4. 1. public class Class1{ public static void main(String[] args) {


System.setProperty("webdriver.chrome.driver", "pathto/chromedriver.exe");
WebDriver d = new ChromeDriver(); d.manage().window().maximize();
d.get("URLpathto/abc.html"); d.findElement(By.id("yes")).click();
d.findElement(By.id("radiocheck")).click(); }} 2. public static void main(String[]
args) { System.setProperty("webdriver.chrome.driver",
"pathto/chromedriver.exe"); WebDriver d = new ChromeDriver();
d.get("URLPathtot/abc.html"); List<WebElement> e=
driver.findElements(By.name("radioname")); // Total elements : e.size()); for
(int m=1; m<=e.size();m++){ System.out.println("Text:" +
e.get(m).getAttribute("value")); } } }

Q30."Consider that Selenium web driver is being used in a java web application to create automation
test scripts. The test script has to check if an Element named 'btnClock' is present in the application:
(i) Which code in Selenium is used to create a common method to test if an element is present in an
application to test across applications? (ii) Which code in Selenium can utilize the common method
to test if an Element named 'btnClock' is present in the application? Analyze the given choices and
select the correct set of answers."

Options :

1. (i) private boolean isElementPresent(BasedOn basedOn) { try {


chromeDriver.findElement(basedOn); return true; } catch
(NoSuchElementException exception) { return false; } } (ii) @Test public void
testElementPresence() { if (isElementPresent(BasedOn.name("btnClock"))) {
WebElement btnElement =
chromeDriver.findElement(BasedOn.name("btnClock")); if
(!btnElement.isSelected()) { btnElement.click(); } } else { fail("btnElement is not
available !"); } }

2. (i) @Test public void testElementPresence() { if


(isElementPresent(BasedOn.name) { WebElement btnElement =
chromeDriver.findElement(BasedOn.name); if (!btnElement.isSelected()) {
btnElement.click(); } } else { fail("btnElement is not available !"); } } (ii) private
boolean isElementPresent(BasedOn basedOn) { try {
chromeDriver.findElement('btnClock'); return true; } catch
(NoSuchElementException exception) { return false; } }

3. (i) private boolean isElementPresent(BasedOn basedOn) { try {


chromeDriver.getElement(basedOn); return true; } catch (MissingElement
exception) { return false; } } (ii) @Test public void testElementPresence() { if
(isElementPresent(FindBy.name("btnClock"))) { WebElement btnElement =
chromeDriver.getElement(FindBy.name("btnClock")); if (!btnElement.isPresent())
{ btnElement.click(); } } else { fail("btnElement is not available !"); } }

4. (i) @Test public void testElementPresence() { if


(isElementPresent(FindBy.name(basedOn))) { WebElement btnElement =
chromeDriver.getElement(FindBy.name(basedOn)); if (!btnElement.isPresent()) {
btnElement.click(); } } else { fail("btnElement is not available !"); } } (ii) private
boolean isElementPresent(BasedOn basedOn) { try {
chromeDriver.getElement('btnClock'); return true; } catch (MissingElement
exception) { return false; } }

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy