Back to Practice

Simple Ads Testing

Simple Ads Testing

Practice automating ad verification with static ad placements. These ads are standard AdSense units that load on page load - perfect for learning basic ad testing techniques.

What to Test

  • • Verify ad containers are present in the DOM
  • • Check that ad slots have correct data attributes
  • • Validate ad dimensions and responsive behavior
  • • Test visibility of ad containers
  • • Verify lazy loading behavior (scroll to trigger)

Horizontal Banner Ad

Standard leaderboard format - 728x90

Rectangle Ad

Medium rectangle format - 300x250

In-Feed Ad

Fluid format that adapts to container

Example Test Code

// Selenium - Verify ad container exists
WebElement adBanner = driver.findElement(By.id("ad-banner-horizontal"));
assertTrue(adBanner.isDisplayed());

// Cypress - Check ad slot attribute
cy.get('[data-testid="ad-rectangle"]')
  .find('.adsbygoogle')
  .should('have.attr', 'data-ad-slot');

// Playwright - Verify multiple ads loaded
const ads = await page.locator('.adsbygoogle');
await expect(ads).toHaveCount(3);