1

I am working on a project that requires taking screenshots of many, many pages in multiple browsers (currently three, I believe: IE8, IE9 and Safari). I've used Cross Browser Testing before but experienced enough issues to now consider it a non-option.

Are there other reliable methods? The number of screenshots will be in the hundreds, and may possibly change in the future, so doing this manually is also not really an option.

3
  • Is taking screenshots of browser windows an option? In that case, maybe GUI-automation utilities like autohotkey can help.
    – Jokester
    Jul 15, 2013 at 14:33
  • Would rather not include the browser chrome as that would require removing them manually later. Jul 15, 2013 at 14:35
  • 1
    You should list/explain what issues you ran into with Cross-browser-testing. Jul 15, 2013 at 14:35

2 Answers 2

1

You mentioned having tried Cross Browser Testing before, so before I go into "roll your own" solutions, just be aware that there are several other (older) services, my favourite being Browser Shots.

That being said, what you've described is entirely possible, although it will require some programming knowledge to accomplish. Regardless of the programming language though, the application should follow the same basic "algorithm":

for each url in url_list:
    for each browser in browser_list:
        launch_browser(browser, url)
        take_screenshot(filename = date & browser & url)
        terminate_browser(browser)

Lately I've gotten into Python, and while any other language would be acceptable here (I'll assume your platform is constrained to Windows given your want to test the sites in IE8/9), there are several existing Stack Overflow questions which should be more than enough to get you on your way:

  • Automate firefox with python? (you will need to find some way of controlling the browser with Python; at minimum though, I believe you can simply invoke the browser executable and pass it a URL as an argument, bypassing the need to do this at all [except if you need to take multiple screenshots of a page, because scrolling might require browser-specific control])
  • Get screenshot on Windows with Python?
  • How to get a website screenshot in python (more useful just for concepts, as some of these solutions use a rendering engine from Python itself, e.g. WebKit)
0

It depends on your site/application. If it is compatible with such services (i.e. the areas you want to test can be accessed by GET request requiring no extra context such as a validated user session) then there are several services out there to get screenshots from many different browsers and versions. http://browsershots.org/ is one that comes up from a quick search, though I've never used any of these myself so I can't directly comment on reliability.

For interactive tests there is https://browserling.com/ though that is not going to be massively more convenient than running your tests in multiple browsers locally.

There are packages that support completely automated web application testing, though these require some considerable setup to do their job well (some teams I work with use Selenium for automated regression testing, though I'm not sure if it supports taking screenshots as part of its results reports). This is getting on towards development/testing discussion though, so if it is the sort of thing you are looking for you might get better advice over on stackoverflow.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .