JavaScript Operators

Operators in JavaScript are symbols used to perform operations on variables and values. They are essential for writing logic, calculations, and conditions

1. Arithmetic Operators

Used for mathematical calculations.

OperatorDescriptionExample
+Addition5 + 2 = 7
-Subtraction5 - 2 = 3
*Multiplication5 * 2 = 10
/Division10 / 2 = 5
%Modulus (remainder)5 % 2 = 1
**Exponentiation2 ** 3 = 8

Example:

let a = 10;
let b = 3;console.log(a + b); // 13
console.log(a % b); // 1

2. Assignment Operators

Used to assign values to variables.

OperatorExampleMeaning
=x = 5Assign 5
+=x += 3x = x + 3
-=x -= 2x = x – 2
*=x *= 2x = x * 2
/=x /= 2x = x / 2

Example:

let x = 5;
x += 3; // 8

3. Comparison Operators

Used to compare two values (returns true/false).

OperatorDescription
==Equal (value only)
===Strict equal (value + type)
!=Not equal
!==Strict not equal
>Greater than
<Less than
>=Greater than or equal
<=Less than or equal

Example:

console.log(5 == "5");   // true
console.log(5 === "5"); // false

4. Logical Operators

Used to combine conditions.

OperatorDescription
&&AND
`
!NOT

Example:

let age = 20;if (age > 18 && age < 30) {
console.log("Young adult");
}

5. Unary Operators

Operate on a single operand.

OperatorDescription
++Increment
--Decrement
typeofReturns type
!Logical NOT

Example:

let num = 5;
num++; // 6console.log(typeof num); // number

6. Ternary Operator

Short form of if-else.

Syntax:

condition ? value1 : value2;

Example:

let age = 18;
let result = age >= 18 ? "Adult" : "Minor";

7. Special Operators

Some useful additional operators:

OperatorDescription
?.Optional chaining
??Nullish coalescing
inCheck the property in the object
instanceofCheck object type

Example:

let user = {};
console.log(user?.name); // undefined (no error)let value = null ?? "default";
console.log(value); // "default"

✅ Summary

  • Arithmetic → calculations
  • Assignment → assign values
  • Comparison → compare values
  • Logical → combine conditions
  • Ternary → short if-else
  • Special → modern JS features

JavaScript Variables

What Are Variables in JavaScript?

In JavaScript, variables are declared using var, let, and const. These keywords define how variables behave in terms of scope and mutability. Modern JavaScript development strongly favors let and const because they provide better control and reduce unexpected bugs. If you’re building dynamic websites or applications, understanding variables is absolutely essential because they drive logic, interactivity, and data handling.

Why Variables Matter in Programming

Variables allow your program to process user input, perform calculations, and manage application state. Think of them as the memory of your application. Without variables, even simple tasks like storing a username or calculating a total price would be impossible.

Real-Life Analogy for Variables

Consider a backpack you carry every day. You can put books, gadgets, or food inside it. Some items you replace frequently, while others stay the same. That’s exactly how variables behave depending on how you declare them.


Types of Variable Declarations

Understanding var

The var The keyword is the oldest method for declaring variables in JavaScript. It is function-scoped, meaning it is accessible throughout the function in which it is defined. One unique characteristic of var is that it allows both redeclaration and reassignment, which can sometimes introduce bugs if not handled carefully.

Because of these limitations, developers rarely use var in modern applications unless maintaining legacy code.


Understanding let

The let keyword was introduced in ES6 and is now widely used. It provides block-level scope, meaning the variable is only accessible within the block {} where it is defined. This makes code more predictable and easier to debug.

Using let ensures that variables don’t accidentally leak outside their intended scope.


Understanding const

The const keyword is used to declare variables whose values should not change. Once assigned, a const variable cannot be reassigned. However, if the variable holds an object or array, its internal properties can still be modified.

This makes const ideal for values that should remain constant throughout the program.


Key Differences Between var, let, and const

Scope Explained

KeywordScope Type
varFunction/Global
letBlock
constBlock

Reassignment vs Redeclaration

KeywordReassignRedeclare
varYesYes
letYesNo
constNoNo

Hoisting Behavior

JavaScript uses a mechanism called hoisting, where variable declarations are moved to the top of their scope during execution. However, var is initialized with undefined, while let and const remain uninitialized until execution reaches their declaration.


Rules for Naming Variables

Valid Naming Conventions

  • Start with a letter, _, or $
  • Can include numbers (not at the beginning)
  • Case-sensitive

Common Mistakes to Avoid

  • Using reserved keywords
  • Starting names with numbers
  • Using unclear variable names

Rules to define a variable name

✅ 1. Allowed Characters

  • Variable names can contain:
    • Letters (a–z, A–Z)
    • Digits (0–9)
    • Underscore (_)
    • Dollar sign ($)

✔ Example:


❌ 2. Cannot Start with a Number

  • A variable name must NOT start with a digit

❌ Wrong:

✔ Correct:


❌ 3. No Spaces Allowed

  • Variable names cannot contain spaces

❌ Wrong:

let user name;

✔ Correct:

let userName;

❌ 4. Cannot Use Reserved Keywords

  • You cannot use JavaScript reserved words like:
    • let, var, const, if, else, function, etc.

❌ Wrong:

let var = 10;

✅ 5. Case Sensitive

  • JavaScript is case-sensitive
let name = "John";
let Name = "Doe"; // different variable

✅ 6. Use Meaningful Names (Best Practice)

  • Always use descriptive names

✔ Good:

let userAge = 25;
let totalPrice = 100;

❌ Bad:

let x = 25;

✅ 7. Use camelCase (Convention)

  • JavaScript commonly uses camelCase

✔ Example:

let firstName;
let totalAmount;

✅ 8. Avoid Special Characters

  • Do NOT use symbols like @, #, %, etc.

❌ Wrong:

let user@name;

✅ 9. Use let, const, or var

  • Modern JavaScript prefers:
    • let → for changeable values
    • const → for constants
let age = 20;
const PI = 3.14;

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