Tips on cross browser Web testing

 

Summary

Justin James discusses using tools such as Scout and Selenium for test UIs in different browsers.

Events

Echelon 2012
June 11 and 12, 2012

University Cultural Centre, National University of Singapore

Startup Asia Jakarta 2012
June 7 and 8, 2012

12th Floor, Annex Building, Wisma Nusantara Complex, Jl. M.H. Thamrin No. 59 Jakarta 10350, Indonesia

MMA Forum Singapore
April 23-25, 2012

Grand Hyatt Singapore

As Web applications and Web pages quickly become the dominant computing paradigm, one thing has become a giant stick in the eye: different Web browsers simply work differently. One can decry this all they want, but the various Web standards leave enough room for interpretation (often on purpose) for browsers to do things differently, especially as you switch from one form factor to another. Hopefully, as the HTML5 spec gets closer to being locked down, and more test suites come out for it, much of the difficulties will be resolved, but until then, we need to test on a variety of platforms.

Up until recently, it was pretty easy to check your UI in different browsers, because there were only two with any significant market share. When Chrome became a significant player, it altered the landscape a bit. Also, Macs have grown their market share enough where Safari testing should not be ignored. The real elephant in the room, though, are the multiple flavors of Internet Explorer. Unlike other browsers, IE tends to not get updated by many people for quite some time. To make matters worse, each version of IE tends to be substantially different from previous versions.

For smaller sites or less important projects, it may be enough to just do a quick browse through of the site with a few different browsers. Fortunately, Chrome, Safari, and Opera all look the same regardless of the platform they are on (although if the pixels have different sizes, that can cause some display problems depending on what units your CSS uses). There are also a lot of good tools (such as Microsoft Expression Web and Dreamweaver) that let you do a variety of different previews using different browser engines, sometimes in real time, that allow you to quickly spot differences and problems. One option is to have a variety of virtual machines with different browsers. If you'd like to avoid the headache of managing that (I for one dislike it), Sauce Labs has a great offering called Scout that is like having your own test lab with every imaginable browser install for Windows and Linux.

What has really changed, though, is the explosive growth of the mobile market. All of a sudden, you have a wide variety of different form factors with different implementations of different browsers on them. One nice thing that's been happening is that the mobile devices are quickly converging on using mobile versions of desktop browsers, instead of their own specialized browsers. As a result, it will become easier to test, since you can take your desktop browser, simulate the mobile screen size, and set the user agent to a mobile version and have the browser use the mobile media type for CSS, and get a really good approximation (if not an exact replica) of what a mobile user will see. If you are serious about mobile testing, though, you will still want to get the appropriate devices to ensure that the experience (particularly with readability and the touch UI) is usable.

In terms of testing the JavaScript and backend code, your best bet is Selenium. Selenium is a system for writing unit tests for Web apps, and can even control a variety of browsers like a user would, to allow you to evaluate what real-world use is like. Again, I am going to throw out Sauce Labs' name, as its OnDemand offering is a hosted Selenium product. Selenium is a big enough product to warrant an article all by itself. I've kicked the tires on it a bit, and I've looked at zillions of other products (most of which cost a small fortune, or are absolutely useless), and I think it's worth a serious look. You can expect to see an in-depth article on Selenium in the near future.

Justin James is an employee of Levit & James, Inc. in a multidisciplinary role that combines programming, network management, and systems administration. He has been blogging at TechRepublic since 2005.

Talkback

Add your opinion

In order to post a comment, you need to be registered. (Sign In or register below)

Post your comment

ZDNet Asia Live

Malaysia organizations don't realize severity of cyberattacks http://t.co/FFems54Q

China solar cell makers seek Taiwan partnerships http://t.co/p5Hh7kJD

Big data acquisitions pave way to fast, effective innovation http://t.co/hdiEfBsz via @zdnetasia

Integration, focused investments to propel Windows Phone: By Kevin Kwang , ZDNet Asia on May 23, 2012 (2 hours a... http://t.co/E7tsZbHJ

Integration, focused investments to propel Windows Phone http://t.co/u9TqjQ8C

ZDNet Asia IT Salary Benchmark 2012 http://t.co/rVwYlV7H

AsiaClassifiedToday. Integration, focused investments to propel Windows Phone - ZDNet Asia: S... http://t.co/47tdjZyG #asia #google #biz

Malaysian organizations are apathetic about information security and fail to realize they are potentially under... http://t.co/XeuvbXrs

Big data acquisitions pave way to fast, effective innovation - ZDNet Asia News http://t.co/vDZpl0lu

"Big data acquisitions pave way to fast, effective innovation" including @Vivisimo_Inc (client) in @ZDnetAsia http://t.co/yNSdPqbb

Homegrown smartphone OSes gaining favor in China: 59 Jakarta 10350, Indonesia Locally-made mobile operating syst... http://t.co/BruP98Es

RT @MDMGeek: Big data acquisitions pave way to fast, effective innovation - ZDNet Asia http://t.co/ky8YgPAn #Bigdata #analytics via @ciropuglisi

Integration, focused investments to propel Windows Phone http://t.co/6JkDa9sB

RT @AsianFashionLaw: Malaysia offers some manufacturing benefits over China http://t.co/bMquIFiX

Acquisitions in the Big Data market increasingly important to enterprises… http://t.co/Br4BkXyZ

So much as we know , MTK6575 extremely integrated frequency1GHz ARM Cortex-A9 processor, the superiority of 3G / HSPA Modem, and help the...

1 day ago by y15822137359 on 5 SaaS adoption speed bumps to avoid

I reckon your view: "CRM is strategy, not software", if a company replicating the approach uses in ERP implementation into CRM, what they...

2 days ago by wykoong on Gartner: Mobile CRM gives better ROI than social

This video will teach you about the Excel fill handle but also provide you with a workook to download... http://www.youtube.com/watch?v=...

3 days ago by TradeBrother on A quick fill handle trick for Microsoft Excel

waiting...

5 days ago by eapete on What should count in a company's market value?

Boy, you've opened a can of worms now.

Wait for the rants & raves.

5 days ago by eapete on What should count in a company's market value?

I was puzzling before this whether to replicate the success formula we executed for a financial institute, and come out with a standard s...

5 days ago by wykoong on Drop the egos, copy ideas, then innovate