Python List MCQs

Python List MCQ Quiz (Random 10 Questions)

Python String MCQs

Python String Quiz (Random 10 of 50)

🔄 Refresh the page to get a new set of questions.

⏳ Time Left: 120 seconds

Automation Practice Page

Text Fields





Radio Buttons



Checkboxes



Dropdown (Select)

Multi Select Dropdown

Buttons



JavaScript Alerts



File Upload

Date and Time Pickers





Links

Open Google
Go to Bottom

Web Table

ID Name Role
1 Deepesh Trainer
2 Rahul Tester
3 Anita Developer

Iframe

Hidden Element

Enabled & Disabled Fields



Image

Sample Image

Mouse Hover

Bottom of Page

This is the bottom of the page for scrolling practice.

Ultimate Automation Practice Page

Auto Suggestions (Google Style)

AJAX Success & Network Failure

Stale Element Simulation

Drag and Drop

Drag Me


Drop Here

Keyboard Actions

Nested Shadow DOM

Login Page

mysocial

Connect with friends and the world around you on MySocial.

Robot Framework Automation with AI Integration (Beginner to Advanced)

course fee poster


Course highlights

    • Training Mode: Online Zoom Session

    • Duration: 1 Month

    • Recorded sessions are available

    • Daily 1 hr sessions from Monday to Friday.

    • Instructor Name: Deepesh Yadav

Course Content

Module 1: Introduction to Robot Framework

    • Overview of Test Automation

    • Features and Advantages of Robot Framework

    • Installation and Setup (Python, PIP, Robot Framework, IDEs)

    • Directory Structure and Test Suite Organization

    • Writing the First Test Case

    • Executing Tests via Command Line and IDE


Module 2: Core Syntax and Test Structures

    • Test Cases, Keywords, and Variables

    • Settings, Variables, Test Cases, and Keywords Sections

    • Built-In Libraries Overview (String, Collections, DateTime, etc.)

    • Using Tags, Documentation, and Metadata

    • Logging and Reporting


Module 3: Working with SeleniumLibrary

    • Installing and Importing SeleniumLibrary

    • Browser Interaction (Open Browser, Click Element, Input Text, etc.)

    • Locators and XPath Strategies

    • Waits, Timeouts, and Synchronization

    • Handling Alerts, Windows, and Frames

    • Taking Screenshots and Validating UI Elements

    • Cross-Browser Testing


Module 4: API Automation with Robot Framework

    • Introduction to API Testing

    • Working with RequestsLibrary

    • GET, POST, PUT, DELETE Methods

    • Handling Authentication (Basic, Bearer Tokens)

    • Validating JSON/XML Responses

    • Schema Validation

    • Integrating with External Data (CSV, Excel, JSON)


Module 5: AI Integration

    • Overview of AI in Test Automation

    • Integration of ChatGPT, Copilot, and Cursor for Intelligent Test Generation

    • Using AI to Auto-Generate Test Cases and Keywords

    • AI-driven Code Suggestions in PyCharm and VS Code

    • Automating Test Documentation with AI

    • Integrating AI Chatbots with Robot Framework

    • Smart Error Analysis using AI Models


Module 6: GitHub and Version Control Integration

    • Git Basics and Repository Setup

    • Pushing and Pulling Robot Test Projects

    • Branching, Merging, and Conflict Resolution

    • Integrating GitHub Actions with Robot Framework

    • CI/CD Pipeline Overview


Module 7: PyCharm Integration

    • Installing and Configuring PyCharm for Robot Framework

    • Plugins and Run Configurations

    • Debugging Robot Tests in PyCharm

    • Code Completion and Keyword Assistance

    • Integrating AI Tools (Copilot, Cursor, ChatGPT in PyCharm)


Module 8: Data-Driven and Keyword-Driven Frameworks

    • Creating Reusable Custom Keywords

    • Working with Resource Files

    • Using Variables and Dynamic Test Data

    • Reading Data from Excel, CSV, JSON

    • Implementing Keyword-Driven Frameworks

    • Parameterized and Loop-Driven Test Cases


Module 9: Advanced Framework Design

    • Designing Scalable Automation Frameworks

    • Modular Test Architecture

    • Error Handling and Retry Logic

    • Parallel Test Execution (Pabot Integration)

    • Custom Library Development in Python

    • Integrating Database Testing

    • Working with API + UI Combined Tests


Module 10: CI/CD and Jenkins Integration

    • Jenkins Overview and Setup

    • Creating Jenkins Pipeline for Robot Tests

    • Running Tests from GitHub via Jenkins

    • Generating HTML Reports in Jenkins

    • Automated Notifications (Slack/Email Integration)

    • Using Docker Containers for Test Execution


Module 11: Reporting and Analytics

    • Default Robot Framework Reports and Logs

    • Generating Custom HTML Reports

    • Integrating with Allure Reports

    • Visualizing Test Metrics

    • AI-based Test Report Analysis


Module 12: Real-World Projects

    • End-to-End Web Application Automation

    • REST API + UI Automation Combined Framework

    • Continuous Integration Pipeline Project

    • AI-Assisted Automation Project using ChatGPT API


Module 13: Best Practices and Interview Preparation

    • Framework Design Best Practices

    • Common Interview Questions for Robot Framework and Python Automation

    • Industry Use Cases and Portfolio Building

    • Live Project to automate end-to-end Scenarios and Integration with CI/CD Pipeline.

Students Feedback

 Python tuple program to join tuples if the initial elements of the sub-tuple are the same

This Python Tuple program will check the initial value of all sub-tuples, if the initial value of two sub-tuple are the same, then it will merge both the tuple.

Input:
[(3,6,7),(7,8,4),(7,3),(3,0,5)]

Output:
[(3,6,7,0,5),(7,8,4,3)]

				
					# take input list value that contains multiple tuples
l1 = [(3, 6, 7), (7, 8, 4), (7, 3), (3, 0, 5)]

# initiate  a variable to store the required output
output = []

# initiate a loop with range of length of list l1.
for i in range(len(l1)):
    # initiate nested loop
    for j in range(i+1, len(l1)):
        # check any two same tuple initial values are same
        if l1[i][0] == l1[j][0]:
            # if two tuple initial value are same, then combine both tuple.
            # and store in output list.
            output.append(tuple(list(l1[i]) + list(l1[j][1:])))
        else:
            continue

print(output)
				
			
Output:
				
					# Output:
[(3, 6, 7, 0, 5), (7, 8, 4, 3)]
				
			

Python tuple program to add row-wise elements in Tuple Matrix

This Python tuple program will add a tuple of values as row-wise elements in the tuple matrix.

Input:
A = [[(‘sqa’, 4)], [(‘tools’, 8)]]
B = (3,6)

Output:
[[(‘sqa’, 4,3)], [(‘tools’, 8,6)]]

				
					var_a = [[('sqa', 4)], [('tools', 8)]]
var_b = (3, 6)
print("Input A : ", var_a)
print("Input B : ", var_b)

output = []

# initiate a loop till length of var_a
for i in range(len(var_a)):
    # get tuple value with the help of indexing of var_a and connvert into list
    l1 = list(var_a[i][0])
    # check if value of i is less than length of var_b
    if i < len(var_b):
        # append new value to the list
        l1.append(var_b[i])
    # now convert list into tuple and append to output list
    output.append([tuple(l1)])

print(output)
				
			

Output:

				
					Input A :  [[('sqa', 4)], [('tools', 8)]]
Input B :  (3, 6)

Output : 
[[('sqa', 4, 3)], [('tools', 8, 6)]]
				
			

Dummy Booking Website

Dummy ticket websites provide different web elements to do the automation

Dummy Ticket Booking Website

Choose the correct option:

  • Dummy ticket for visa application – $200
  • Dummy return ticket – $300
  • Dummy hotel booking ticket – $400
  • Dummy hotel and flight booking – $500
  • Cab booking and return date – $600

Passenger Details

First Name

Last Name

Date of birth*

Sex*

Male Female

Number of Additional Passangers

Travel Details

One Way Round Trip

Delivery Option


How will you like to receive the dummy ticket(optional)

Email WhatsApp Both

Billing Details








Most Visited Cities

Select Option City ID City Name Passengers
6001 Mumbai 1033
6002 Pune 2002
6003 Indore 3000
6004 Kolkata 5000
6005 Hyderabad 6000
6006 Orangabad 3456
6007 Delhi 5666

is_selected Method

The is_selected() method in Selenium is used to check whether a web element, such as a checkbox, radio button, or option in a dropdown, is currently selected or not. It returns True if the element is selected and False if it is not.

Syntax:

element.is_selected()

Example:

from selenium import webdriver
from selenium.webdriver.common.by import By

#
Set up the driver (assuming you're using Chrome)
driver = webdriver.Chrome()

#
Open a webpage with website example
driver.get('https://example.com')

#
Locate a checkbox or radio button element
checkbox = driver.find_element(By.ID, 'checkbox_id')

#
Check if the checkbox is selected
if checkbox.is_selected():
print("The checkbox is selected.")
else:
print("The checkbox is not selected.")

#
Close the browser
driver.quit()

Example with checkbox selection

from selenium import webdriver
from selenium.webdriver.common.by import By

driver = webdriver.Chrome()

driver.implicitly_wait(20)
driver.maximize_window()

#
Open dummy website on the browser
driver.get('
https://sqatools.in/dummy-booking-website/')

#
get check element
checkbox_element = driver.find_element(By.XPATH, "//table//tr[2]//input")

#
check is_selected status before selecting checkbox
print("is_selected status:", checkbox_element.is_selected()) # False

checkbox_element.click()

#
check is_selected status after selecting checkbox
print("is_selected status:", checkbox_element.is_selected() # True

#
Close browser
driver.quit()


Explanation:

  • element.is_selected() works primarily for form elements like checkboxes, radio buttons, and options within a <select> dropdown.

  • If the element is selected (checked for a checkbox, selected for a radio button or dropdown option), it returns True. Otherwise, it returns False.

This method is useful when you need to verify the state of form elements before taking further action.


SQL Revoke Statement

SQL Revoke Statement Tutorial

Welcome to our comprehensive tutorial on the SQL REVOKE statement! In this guide, we will explore the SQL REVOKE statement, which is used to revoke specific privileges or permissions previously granted to users or roles within a database. We’ll provide a detailed understanding of the REVOKE statement, its advantages, use cases, and demonstrate its usage with practical examples using MySQL syntax.

Understanding SQL REVOKE Statement

The SQL REVOKE statement is a Data Control Language (DCL) statement used to revoke previously granted privileges or permissions from users or roles on database objects. It allows administrators to remove specific access rights, ensuring data security and access control in a database. REVOKE statements help in controlling who can perform certain actions on database objects.

The basic syntax of the REVOKE statement is as follows:

				
					REVOKE privileges
ON object_name
FROM user_or_role;

				
			

– `privileges`: The specific privileges or permissions being revoked (e.g., SELECT, INSERT, UPDATE, DELETE).

– `object_name`: The name of the database object (e.g., table, view) on which the privileges are revoked.

– `user_or_role`: The user or role from whom the privileges are revoked.

Advantages of Using REVOKE Statement

  • Access Control: REVOKE statements allow administrators to fine-tune access control by removing specific privileges.
  • Data Security: Helps maintain data security by restricting access to sensitive data or operations.
  • Data Integrity: Prevents unauthorized modifications to data, maintaining data integrity.
  • Change Management: Facilitates change management by adjusting user privileges as roles change.
  • Compliance: Assists in meeting compliance requirements by controlling data access.

Use Cases for REVOKE Statement

  • Access Removal: Revoke previously granted privileges when a user’s role changes or when access is no longer required.
  • Data Security: Quickly respond to security breaches by revoking unauthorized access.
  • Data Cleanup: Remove access to objects when they are no longer needed or relevant.
  • Compliance Maintenance: Adjust privileges to align with changing compliance requirements.
  • Temporary Access: Revoke temporary privileges granted for specific tasks or projects.

Example of SQL REVOKE Statement

Let’s illustrate the SQL REVOKE statement with an example of revoking the SELECT privilege on a “students” table from a user.

Sample REVOKE Statement (Revoking SELECT Privilege):

				
					-- Revoke the SELECT privilege on the "students" table from user "john"
REVOKE SELECT
ON students
FROM john;

				
			

In this example, the REVOKE statement removes the SELECT privilege on the “students” table from the user “john.” This action prevents “john” from querying data from the table.

The SQL REVOKE statement is a critical tool for maintaining data security and access control in database systems, ensuring that only authorized users can perform specific operations on database objects.