The Ultimate Selenium Automation Practice Guide - 50+ Exercises with Demo Websites

Introduction: Master Selenium Through Hands-on Practice

This comprehensive guide combines real-world demo websites with structured practice exercises to take your Selenium automation skills from beginner to expert level. Whether you're preparing for QA interviews or upskilling your team, this resource provides:


✅ 50+ categorized exercises with difficulty ratings
✅ 25+ demo websites for practical implementation
✅ Sample code solutions in Java/Python
✅ Interview preparation tips for each concept
✅ Pro testing frameworks and design patterns



Section 1: Foundational Exercises (Beginner Level)


1. Form Automation Mastery


Demo Site: DemoQA Automation Practice Form


Exercises:

  1. Automate text field validations

  2. Handle radio buttons and checkboxes

  3. Implement date picker selection

  4. Manage file uploads/downloads


Pro Tip: Use the Page Object Model pattern:


 java


public class PracticeFormPage {
    @FindBy(id = "firstName") WebElement firstName;
    // Other elements
    
    public void submitForm(TestUser user) {
        firstName.sendKeys(user.getFirstName());
        // Continue form filling
    }
}


2. Google Search Automation


Demo Site: Google.com

Challenge: Implement explicit waits for search results

Solution:

 python

from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC

search_box = driver.find_element(By.NAME, "q")
search_box.send_keys("Selenium WebDriver")
search_box.submit()

# Wait for results
WebDriverWait(driver, 10).until(
    EC.presence_of_element_located((By.CSS_SELECTOR, "h3"))



Section 2: Intermediate Projects


3. E-Commerce Website Testing


Demo Site: AutomationExercise

Comprehensive Project:

  1. User registration workflow

  2. Product search and filtering

  3. Cart management system

  4. Checkout process automation


Framework Enhancement:
Implement Data-Driven Testing using JSON:


 java

@DataProvider(name = "userData")
public Object[][] getUserData() throws IOException {
    return JsonToArrayConverter.readTestData("users.json");
}


4. Broken Link Detection


Demo Site: [Any live website]

Advanced Solution:


python


from urllib.request import Request, urlopen
from urllib.error import URLError, HTTPError

all_links = driver.find_elements(By.TAG_NAME, "a")

for link in all_links:
    url = link.get_attribute("href")
    try:
        req = Request(url)
        response = urlopen(req)
    except (HTTPError, URLError) as e:
        print(f"Broken link: {url} | Status: {e.code}")



Section 3: Advanced Challenges


5. Multi-Tab Browser Automation


Demo Site: The Internet

Key Solution:


 java

 

String mainWindow = driver.getWindowHandle();

// Open new tab
driver.findElement(By.linkText("Click Here")).click();

// Switch to new tab
for (String handle : driver.getWindowHandles()) {
    if (!handle.equals(mainWindow)) {
        driver.switchTo().window(handle);
        break;
    }
}

// Perform actions in new tab
Assert.assertEquals("New Window", driver.getTitle());


6. Dynamic Web Table Handling


Demo Site: DemoQA Web Tables

Innovative Approach:


 python


def get_table_data(driver):
    rows = driver.find_elements(By.XPATH, "//div[@class='rt-tr-group']")
    data = []
    
    for row in rows:
        cells = row.find_elements(By.CLASS_NAME, "rt-td")
        row_data = [cell.text for cell in cells if cell.text]
        if row_data:
            data.append(row_data)
    
    return pd.DataFrame(data, columns=["Name", "Age", "Email", "Salary", "Department"])



Section 4: Specialized Automation Projects


7. File Upload/Download with Robot Class


Demo Site: The Internet File Upload

Hybrid Solution:


 java


// Selenium + Robot Class integration
String filePath = "/path/to/testfile.txt";
driver.findElement(By.id("file-upload")).sendKeys(filePath);

// Robot class for OS-level confirmation
Robot robot = new Robot();
robot.keyPress(KeyEvent.VK_ENTER);
robot.keyRelease(KeyEvent.VK_ENTER);


8. AJAX Form Handling


Demo Site: Selenium Easy AJAX Form

Best Practice:


 python 


# Custom wait condition for AJAX completion
def ajax_complete(driver):
    return driver.execute_script("return jQuery.active == 0")

WebDriverWait(driver, 10).until(ajax_complete)



Practice Roadmap & Learning Path


30-Day Intensive Plan:


 markdown


    Week 1: Core Selenium Commands (Forms, Navigation)
    Week 2: Framework Building (POM, Data-Driven)  
    Week 3: Advanced Scenarios (Dynamic Elements, Iframes)
    Week 4: Real-world Projects (E-commerce, SaaS apps)


Selenium IDE Tutorial  << Previous     ||     Next >>  What is Selenium WebDriver?

Comments

  1. Thanks for publishing such great information. You are doing such a great job. This information is very helpful for everyone. Keep sharing about web development company in pune. Thanks.

    ReplyDelete
  2. Thanks for publishing such great information. You are doing such a great job. This information is very helpful for everyone. Keep sharing about Website Development Service Provider. Thanks.

    ReplyDelete
  3. You've written a very useful article. This article provided me with some useful knowledge. Thank you for providing this information. Keep up the good work. Web Development Company in Abu Dhabi

    ReplyDelete
  4. Not many people realise that they have the small errors within their website that create such a big impact to the search engines. sonoma-county org

    ReplyDelete
  5. You have provided valuable data for us. It is great and informative for everyone. Keep posting always about Website Security Solutions. I am very thankful to you.

    ReplyDelete
  6. Much appreciated for distributing such awesome data. You're doing such a extraordinary work. This data is exceptionally accommodating for everybody. Keep sharing approximately custom web design company in the USA. Thanks.

    ReplyDelete
  7. You have provided valuable data for us. It is great and informative for everyone. Keep posting always about Webhosting Mexico. I am very thankful to you.

    ReplyDelete
  8. This is excellent information which is shared by you. This information is meaningful and magnificent for us to increase our knowledge aboutWebsite Designing Company in Christchurch . Keep sharing this kind of information. Thank you.

    ReplyDelete
  9. You have provided valuable data for us. It is great and informative for everyone. Keep posting always about website developer in dubai. I am very thankful to you.

    ReplyDelete
  10. These tips may help me in the future. Thank you for sharing visit also proximity switch .

    ReplyDelete
  11. You have shared a lot of information in this article. I would like to express my gratitude to everyone who contributed to this useful article. Keep posting. Web Development Company In Minnesota

    ReplyDelete
  12. Thanks for publishing such great information. You are doing such a great job. This information is very helpful for everyone. Take a look at this Website Design Services. Thanks.

    ReplyDelete
  13. Wow, What an Excellent post. I really found this to much informative. It is what I was searching for. I would like to suggest you that please keep sharing such type of info.app development cost uk

    ReplyDelete
  14. I truly appreciate this post. I’ve been looking everywhere for this! Thank you again.
    Reference: https://proweb365.com/

    ReplyDelete
  15. I will share it with my other friends as the information is really very useful. Chicago Web Design Company. Keep sharing your excellent work.

    ReplyDelete

  16. post is amazing thanks for sharing so hard to find post like this

    ReplyDelete
  17. Thank you for sharing a informative and valuable post with us. Keep writing good things!
    https://marketresearchcommunity.com/

    ReplyDelete
  18. I was reading some of your content on this website and I conceive this internet site is really informative ! Keep on putting up.
    Digital Marketing services in lahore<>

    ReplyDelete
  19. I have another site to be added to the list, https://magento.softwaretestingboard.com/

    ReplyDelete
  20. Thanks for sharing such an informative content. I would like to tell you about my blog how to delete comments on tiktok

    ReplyDelete
  21. Thanks for this article! This post has all information which I looking for.

    ReplyDelete
  22. Thanks to post an informative article. So you post too.

    ReplyDelete
  23. Clipping Path Us is a dedicated clipping path service provider managed by some professional and experienced graphic designers. Our buyers have a good knowledge of our photo editing services and recognize it as one of the best crop path service companies in the world. Clipping Path Service Inc is a model image editing platform. Our clients have benefited their business by using our high quality, professional and affordable Photoshop services. We have more than 150 Photoshop experts to provide all types of image editing tasks. We reportedly provide cropping path, color correction, image masking, neck join, photo retouching, background removal and e-commerce image editing services worldwide. We believe that our clients' success means our success. That is why we are committed to providing high quality work. Clipping Path is an excellent choice for a high quality background removal service from Clipping Path Us. As today's preferred clipping path service provider in Southeast Asia, we provide all types of clipping path services at the lowest price, whether it's image background removal or multi-color correction. So you can rely on us when it comes to road cutting service Clipping path service


    #clippingpath #clippingpathservice #backgroundremoval #imagemasking #dropshadowservice #reflectionshadowservice #photoretouchingservice #colorcorrectionservice #ecommerceimageediting #carimageediting #neckjointservice #ghostmannequinservice #invisiblemannequinservice #removefromimage #whitebackgroundremove #photocutout #imageediting #photomanipulation


    ReplyDelete

  24. Hello, you are sharing with me a wonderful article.

    ReplyDelete
  25. Thanks for communicating such enlightening content. I would like to inform you regarding my blog. San Jose Heater Repair

    ReplyDelete
  26. Hello, you are communicating with me a great article.

    ReplyDelete

Post a Comment

Popular posts from this blog

Mastering Selenium Practice: Automating Web Tables with Demo Examples

Automation Practice: Automate Amazon like E-Commerce Website with Selenium

Top 10 Highly Paid Indian CEOs in the USA

14 Best Selenium Practice Exercises for Automation Practice

Real-World Examples and Demo Scripts in Selenium Python Automation

Top 51 Most Important Selenium WebDriver Interview Questions

What is Java Class and Object?

How I learned Selenium WebDriver in just 4 weeks

How to Automate Google Search with Selenium WebDriver