Search test library by skills or roles
⌘ K

Adaface Sample Selenium Questions

Here are some sample Selenium questions from our premium questions library (10273 non-googleable questions).

Skills

🧐 Question

Medium

AJAX Request Completion Handling
Handling AJAX Requests
Solve
Suppose you are testing a web application with Selenium, where a button click (id="sendRequest") sends an AJAX request to fetch user data. The data, once retrieved, is displayed in a div with id="userData". This div is already present in the HTML with empty text. You need to ensure that the AJAX request is completed and the data is loaded before proceeding. (You can assume that the AJAX request will always succeed.
            
            Consider the following pseudo JavaScript code which is used in the web application:
 image
Given the above code, which of the following Python Selenium code snippets should be used to correctly wait for the AJAX request to complete and the userData to be loaded?
 image

Medium

Handling Dynamic Elements
Multiple Iframes
Dynamic Element Handling
Solve
You are automating a test for a webpage that contains multiple iframes. One of these iframes contains a button with a dynamic ID that always contains the substring "btn". Upon clicking this button, a text box appears within the same iframe, having a dynamic ID containing the substring "txtBox". You have to input text into this text box. The correct iframe does not have any unique identifiable attribute.
            
            Below is the simplified pseudo code to illustrate your initial setup:
 image
How should you modify your code to perform these operations efficiently, ensuring reliable element location and interaction among multiple iframes?
 image

Medium

Handling Mouse Actions
Keyboard and Mouse Actions
Solve
You are automating a test case where a user has to hover over an image, causing a tooltip to appear. After the tooltip appears, the user has to right-click on the tooltip to see a context menu. You have to validate that the context menu appears correctly. The tooltip has an ID of tooltip and the context menu has an ID of contextMenu.
            
            Given the below pseudo code for the page:
 image
Which of the following Selenium Python code snippets should be used to perform the above-described actions and validations?
 image

Easy

Handling Multiple Windows
Window Handles
Switching Windows
Solve
You are working with Selenium to automate a test case where clicking a button on a webpage (http://example.com) opens a new window. You have to perform operations in the new window and then return to the original window. Below is a simplified version of your initial code:
 image
After clicking the button, a new window opens, and you need to input text into a text box in the new window with id="textBox". Afterwards, you need to close this new window and click another button in the original window with id="originalWindowButton".
            
            How should you modify your code to handle the multiple windows and perform the necessary operations?
 image

Medium

Page Object Class
Solve
Our frontend developer for bananas.com created this HTML login form. Which function should they use to implement a method of a Page Object Class for the login form?
 image
 image
🧐 Question🔧 Skill

Medium

AJAX Request Completion Handling
Handling AJAX Requests

3 mins

Selenium
Solve

Medium

Handling Dynamic Elements
Multiple Iframes
Dynamic Element Handling

2 mins

Selenium
Solve

Medium

Handling Mouse Actions
Keyboard and Mouse Actions

3 mins

Selenium
Solve

Easy

Handling Multiple Windows
Window Handles
Switching Windows

3 mins

Selenium
Solve

Medium

Page Object Class

3 mins

Selenium
Solve
🧐 Question🔧 Skill💪 Difficulty⌛ Time
AJAX Request Completion Handling
Handling AJAX Requests
Selenium
Medium3 mins
Solve
Handling Dynamic Elements
Multiple Iframes
Dynamic Element Handling
Selenium
Medium2 mins
Solve
Handling Mouse Actions
Keyboard and Mouse Actions
Selenium
Medium3 mins
Solve
Handling Multiple Windows
Window Handles
Switching Windows
Selenium
Easy3 mins
Solve
Page Object Class
Selenium
Medium3 mins
Solve

Trusted by recruitment teams in enterprises globally

Amazon Morgan Stanley Vodafone United Nations HCL PayPal Bosch WeWork Optimum Solutions Deloitte Microsoft NCS Doubtnut Sokrati J&T Express Capegemini

We evaluated several of their competitors and found Adaface to be the most compelling. Great library of questions that are designed to test for fit rather than memorization of algorithms.


Swayam Narain, CTO, Affable

hashtag image heart icon Swayam
customers across world
Join 1200+ companies in 75+ countries.
Try the most candidate friendly skills assessment tool today.
g2 badges
Ready to streamline your recruitment efforts with Adaface?
Ready to streamline your recruitment efforts with Adaface?
logo
40 min tests.
No trick questions.
Accurate shortlisting.
ada
Ada
● Online
Previous
Score: NA
Next
✖️