Skip to content

ROHITTTTZ/browserstack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

10 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“° EL PAÍS Opinion Automation & Cross-Browser Testing

An end-to-end Selenium WebDriver automation framework built with **Node.js** that performs real-world website interaction, content extraction, API integration, and cloud-based cross-browser testing using **BrowserStack Automate**.

πŸ“Œ Project Overview

This automation solution simulates a realistic QA / Customer Engineering workflow by:

  • Navigating the EL PAÍS news website
  • Extracting the latest Opinion articles
  • Capturing:
    • Spanish Titles πŸ‡ͺπŸ‡Έ
    • Article Content πŸ“„
    • Cover Images πŸ–Ό
  • Translating titles to English πŸ‡¬πŸ‡§
  • Performing repeated word analysis
  • Executing locally and on BrowserStack
  • Running tests in parallel across multiple browsers/devices

🎯 Objectives

βœ” Automate dynamic website interaction
βœ” Demonstrate Selenium WebDriver expertise
βœ” Implement robust DOM/content extraction
βœ” Integrate Translation API
βœ” Handle standard & gallery articles
βœ” Enable parallel execution
βœ” Perform post-processing data analysis
βœ” Validate cross-browser compatibility


🧰 Tech Stack

  • Node.js
  • Selenium WebDriver
  • BrowserStack Automate
  • RapidAPI – Google Translate
  • JavaScript (ES6)
  • dotenv

βš™οΈ Key Functionalities

βœ… Automated Website Navigation

  • Opens EL PAÍS homepage
  • Handles cookie consent popup
  • Navigates to Opinion section

βœ… Dynamic Article Detection

  • Identifies latest Opinion articles
  • Filters valid URLs based on:
    • /opinion/
    • Date pattern (YYYY-MM-DD)

βœ… Robust Content Extraction

Supports:

βœ” Standard Articles
βœ” Gallery / Photo Articles

Extraction Strategy:

  • Uses .a_standfirst (intro/summary)
  • Falls back to meaningful paragraph blocks
  • Avoids UI noise & metadata clutter

βœ… Cover Image Extraction & Download

  • Detects article cover images (figure img)
  • Downloads locally into /images

βœ… Title Translation (Spanish β†’ English)

  • Uses RapidAPI (Google Translate)
  • Handles API response parsing & failures

βœ… Repeated Word Analysis

  • Processes translated titles
  • Detects words repeated more than twice

βœ… Structured Console Reporting

Outputs:

βœ” Article details
βœ” Translation table
βœ” Word repetition analysis
βœ” Execution logs


βœ… BrowserStack Cloud Integration ☁️

  • Executes on cloud browsers/devices
  • Debugging enabled
  • Captures:
    • Network logs
    • Console logs

βœ… Parallel Execution πŸš€

  • Runs across 5 concurrent sessions
  • Cross-browser / cross-device capable
  • Dynamic session naming

☁️ Cloud Testing (BrowserStack)

πŸ–₯ Desktop Browsers

βœ” Windows / macOS
βœ” Chrome / Firefox / Edge / Safari


πŸ“± Mobile Browsers

Mobile execution was initiated but not fully functional.

Observed Issue:

  • Navigation to Opinion section failed
  • EL PAÍS mobile layout uses a hamburger menu
  • Desktop selectors were incompatible with responsive UI

Key Takeaway:

βœ” Demonstrates real-world responsive testing challenge
βœ” Highlights importance of device-specific locators
βœ” Validates complexity of cross-device automation


✨ Features at a Glance

βœ” End-to-end Selenium WebDriver automation
βœ” Intelligent DOM/content extraction strategy
βœ” Standard & gallery article handling
βœ” API-driven title translation
βœ” Parallel cross-browser execution
βœ” BrowserStack cloud validation
βœ” Post-processing text analysis


πŸŽ₯ Demo Video

A short demonstration showcasing:

βœ” Automated article extraction
βœ” Spanish β†’ English title translation
βœ” Parallel BrowserStack execution


πŸ›  Troubleshooting

Issue: Cookie popup blocking navigation
βœ” Solution: Explicit wait & popup handling logic implemented

Issue: Mobile navigation failure
βœ” Cause: Responsive layout using hamburger menu
βœ” Resolution: Requires device-specific locators

Issue: Translation API failure
βœ” Solution: Implemented error handling & fallback logging


πŸ“Š Sample Output

πŸ”Ή Parallel BrowserStack Execution

πŸ”Ή Extracted Article Content

πŸ”Ή Title Translation & Cross-Browser Output

πŸ”Ή Title Translation Table & Word Analysis

πŸ”Ή Final Execution & Test Completion

πŸ”Ή BrowserStack Parallel Build Execution

πŸš€ How to Run the Project

β–Ά Run Locally

1. Install dependencies

npm install

2. Configure environment variables

BROWSERSTACK_USERNAME=your_username
BROWSERSTACK_ACCESS_KEY=your_access_key
RAPIDAPI_KEY=your_api_key

3. Execute the automation

node src/main.js

πŸ‘¨β€πŸ’» Author

Rohith Pradeep

πŸŽ“ Final Year Computer Engineering Student
🏫 Pillai College of Engineering
πŸ”— LinkedIn: linkedin.com/in/rohith-pradeep/

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors