Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7948387
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T01:42:29+00:00 2026-06-04T01:42:29+00:00

The developers at my company have implemented our website to be CSS responsive, and

  • 0

The developers at my company have implemented our website to be CSS responsive, and I am confused how to leverage Selenium to test their work. I have been using Selenium WebDriver (Selenium 2) with Ruby all along for other aspects.

After doing some research online, I came across multiple tools but none worth automating with as they .. aaa… are just web tools to manually check with different screen sizes.

Some examples –

  1. Device Testing for Resonsive CSS Layouts (Manual)
  2. Responsinator
  3. Responsive.is
  4. Responsivepx (much better as more control)

But I can achieve the above very easily using Selenium as well using sel2/ruby

@driver.manage.window.resize_to(480, 725) #iphone potrait

Need help with

  • How to actually test if the css is “responsive” automatically?
  • What are commonly used attributes/aspects to check if page is responding to window resizing?
  • Has anyone used Selenium to QA responsive CSS?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T01:42:30+00:00Added an answer on June 4, 2026 at 1:42 am

    I can think of two ways of doing this.

    One – for each web element you can check its size, location, visibility, etc. After each resize you could compare those parameters with some previously specified values to check if layout has changed.

    Second – image comparison. After each resize you could take a screenshot of the page and compare it to previously saved pattern. There are various image comparison libraries to achieve that. In our company we use ImageMagick. The image comparison however is not suitable for pages under development nor for the ones with changing content. You may get around this problem by hiding the parts of page that are prone to changes with javascript (this is doable with WebDriver).

    I must admit I never had opportunity to test responsive pages neither manually nor automatically, so the above are just my ideas. I do use image comparison for testing "normal" pages, I am not sure if it will be suitable for responsive pages too.

    EDIT

    Unfortunately I don’t know Ruby. Below is an example in Java I hope you can understand it and translate to Ruby somehow. The code simply prints the size and location of every element from the list.

    org.openqa.selenium.Point point;
    org.openqa.selenium.Dimension dimension;
            
    List<WebElement> elementsList = driver.findElements(By.xpath("//some/xpath"));
            
    for (WebElement element : elementsList)
    {
        point = element.getLocation();
        dimension = element.getSize();
        System.out.println("Element name: " + element.getTagName());
        System.out.println("Element size: " + dimension.height + "x" + dimension.width);
        System.out.println("Element location: " + point.x + ":" + point.y);
    }
    

    Note that every invocation of getLocation() and getSize() causes js to be executed (in order to obtain the values) and it costs time. That’s why you should make just one call per element, don’t use something like element.getSize().height + "x" + element.getSize().width – it would take twice as much time comparing to the example above.

    In Ruby the above-mentioned methods are called element.location and element.size

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

At my company we have a group of 8 web developers for our business
We currently have .Net developers and the company is wanting our development team to
The company I work for we have a CBT system we have developed. We
I work for a fortune 500 company in IT and we have developed many
I'm developing a TFS tool to assist the developers in our company. This said
My company is about to hire .NET developers . We work on a variety
The company I used to work with has two developers working fulltime, and a
I work for a small web development company (only 2 to 3 developers) that
We've recently moved our company website to a new host. It is an ASP.NET
At my company we have a really annoying problem with our linker (ld 2.17).

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.