{"id":1277,"date":"2011-03-22T19:57:59","date_gmt":"2011-03-23T02:57:59","guid":{"rendered":"https:\/\/simpleprogrammer.com\/?p=1277"},"modified":"2018-04-13T16:57:47","modified_gmt":"2018-04-13T20:57:47","slug":"guest-post-the-cross-browser-compatibility-myth","status":"publish","type":"post","link":"https:\/\/simpleprogrammer.com\/guest-post-the-cross-browser-compatibility-myth\/","title":{"rendered":"Guest Post: The Cross-Browser Compatibility Myth"},"content":{"rendered":"<p><span style=\"color:#00b050;font-size:small;\"><span style=\"color:#00b050;font-size:small;\"> <\/span><\/span><span style=\"color:#00b050;font-size:small;\"><span style=\"color:#00b050;font-size:small;\"><span style=\"color:#00b050;font-size:small;\"><span style=\"color:#00b050;font-size:small;\"> <\/span><\/span><\/span><\/span><\/p>\n<div><em>This post is a special guest post from my wife, Heather Sonmez, who is an expert on the subject of blackbox automated tests and designing frameworks for them. \u00a0She has designed successful automation frameworks for several companies. \u00a0She deals with software automation and framework design issues on a daily basis, so I thought she might be able to offer some good insight on the topic.<\/em><\/div>\n<div>\n<p><\/div>\n<div>\n<p>John asked me to write a post based on my experience with writing automated tests.\u00a0 I\u2019ve been working as a QA Automation Engineer for the past three and a half years. During this time I have had the opportunity to work with Ruby\/Watir, C#\/Watin, and Java\/Selenium RC. In thinking on a topic, I decided that there\u2019s no time like the present to talk about what I\u2019m presently facing, and would like to share some insight straight from the trench I currently find myself in today:<\/p>\n<\/div>\n<h2>Automation tools that claim to support multiple browsers are LYING<\/h2>\n<p>Currently I am in the process of getting 400 automated tests that run in Firefox to run in Internet Explorer and Chrome. While the tests are using Selenium RC, a tool that claims to work on all three browser platforms, in actuality, many tests are failing and not for good reasons (bugs).<\/p>\n<p>Here\u2019s the rundown on what these overly-ambitious tools aren\u2019t telling you:<\/p>\n<ul>\n<li>Xpath in Browser A isn\u2019t always supported in Browser B<\/li>\n<li>The Dom in Browser A may vary from the Dom in Browser B<\/li>\n<li>Browser B may have built-in security settings that interfere with testing<\/li>\n<li>Bugs in the automation tool itself may cause issues in specific browsers<\/li>\n<\/ul>\n<div><span style=\"font-size:20px;font-weight:bold;\"><strong>The XPath Issue<\/strong><\/span><\/div>\n<p>When it comes to XPath, I fully expected that any given expression was either valid or invalid. But it didn\u2019t take more than one test run in Internet Explorer to suddenly find myself with tests that claimed certain elements didn&#8217;t exist. While Firefox accepted and successfully returned my element using the provided expression, IE claimed the expression itself was invalid. In this particular instance I discovered an issue with Selenium stripping off the end of my xpath statement, thus making it invalid.<\/p>\n<p>But ultimately, whether it&#8217;s the browser or the tool doesn&#8217;t matter because the same expression is not working unequivocably in both browsers.<\/p>\n<p><strong> <\/strong><strong> <\/strong><\/p>\n<h2><strong>The Dom Issue<\/strong><\/h2>\n<p>The next problem I immediately came across was the problem of Dom differences between browsers. In this particular case I had an element that occurred one time in Firefox but twice in IE. My test, expecting one instance of the element, failed. While I can\u2019t tell you why this discrepancy exists (currently under investigation by some client-side engineers), I have a fair degree of confidence in saying this won\u2019t be the last time I come across this issue.<\/p>\n<p>In the quest to support many different browsers, it only follows that one is going to come across conditional browser logic, especially if a company is striving to support multiple browser versions (IE 6, 7, 8, 9). If a developer has to occasionally write browser-specific condition statements, it makes sense that we&#8217;d have to do the same to test specific browsers.<\/p>\n<p><strong> <\/strong><strong> <\/strong><\/p>\n<h2><strong>The Security Issue<\/strong><\/h2>\n<p>If it seems that I\u2019m picking on IE, it\u2019s only because I can\u2019t get very far in running our tests in Chrome. Chrome has special security settings that cause a Selenium exception if your test changes domains mid-run. This can easily be solved by passing a parameter to Chrome which will disable this security feature when the test runs, the trick is figuring out when\/where\/how to pass that parameter.<\/p>\n<p><strong> <\/strong><strong> <\/strong><\/p>\n<h2><strong>The Bug in the Tool Issue<\/strong><\/h2>\n<p>Finally, the last obstacle I\u2019ve come across in multi-browser testing: the tool itself. Any tool, regardless of how fabulous it is, is going to have bugs. Selenium RC has an issue where its select method (responsible for selecting a value in a dropdown\u00a0menu) doesn\u2019t trigger affiliated event handlers-\u00a0in Internet Explorer. To work around this, one can manually call the event handler using Selenium\u2019s runscript() but you will lose some degree of testing confidence in doing so (how do you know the event is really firing in response to a particular user action if you\u2019re manually forcing it in automation?)<\/p>\n<p>Another issue exists around multiple browser windows; if you need more than one open for your test, Selenium is unable to select the second window you open- another outstanding IE issue that has not been resolved.<\/p>\n<p><strong> <\/strong><strong> <\/strong><\/p>\n<h2><strong>Summary<\/strong><\/h2>\n<p>In all fairness, some of these issues have more to do with the browsers themselves than with the automation tool. However, that makes it even more important to realize that when an automation tool says it supports multiple browsers, it\u2019s not without some creativity, troubleshooting, legwork, and maintenance.<\/p>\n<p>Knowing these kinds of issues exist is important in order to decide if and how much browser compatibility testing you want to automate. It&#8217;s definitely something to realize before deciding on a tool just because the tool claims to support other browsers.<\/p>\n<p><strong>Just as there is no silver bullet for writing a web application that works in every browser imaginable, there is no silver bullet for automation either.<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This post is a special guest post from my wife, Heather Sonmez, who is an expert on the subject of blackbox automated tests and designing frameworks for them. \u00a0She has designed successful automation frameworks for several companies. \u00a0She deals with software automation and framework design issues on a daily basis, so I thought she might&#8230;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","footnotes":""},"categories":[44070,50917,45348,415,12,2260],"tags":[],"class_list":["post-1277","post","type-post","status-publish","format-standard","hentry","category-automation","category-bat","category-frameworks","category-guest-post","category-testing","category-web-development"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Guest Post: The Cross-Browser Compatibility Myth - Simple Programmer<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/simpleprogrammer.com\/products\/careerguide\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Guest Post: The Cross-Browser Compatibility Myth - Simple Programmer\" \/>\n<meta property=\"og:description\" content=\"This post is a special guest post from my wife, Heather Sonmez, who is an expert on the subject of blackbox automated tests and designing frameworks for them. \u00a0She has designed successful automation frameworks for several companies. \u00a0She deals with software automation and framework design issues on a daily basis, so I thought she might...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/simpleprogrammer.com\/products\/careerguide\" \/>\n<meta property=\"og:site_name\" content=\"Simple Programmer\" \/>\n<meta property=\"article:published_time\" content=\"2011-03-23T02:57:59+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-04-13T20:57:47+00:00\" \/>\n<meta name=\"author\" content=\"John Sonmez\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"John Sonmez\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/products\\\/careerguide#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/guest-post-the-cross-browser-compatibility-myth\\\/\"},\"author\":{\"name\":\"John Sonmez\",\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/#\\\/schema\\\/person\\\/1abc70edfb189184827740310672de67\"},\"headline\":\"Guest Post: The Cross-Browser Compatibility Myth\",\"datePublished\":\"2011-03-23T02:57:59+00:00\",\"dateModified\":\"2018-04-13T20:57:47+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/guest-post-the-cross-browser-compatibility-myth\\\/\"},\"wordCount\":878,\"commentCount\":2,\"articleSection\":[\"Automation\",\"BAT\",\"Frameworks\",\"Guest Post\",\"Testing\",\"Web Development\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/simpleprogrammer.com\\\/products\\\/careerguide#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/guest-post-the-cross-browser-compatibility-myth\\\/\",\"url\":\"https:\\\/\\\/simpleprogrammer.com\\\/products\\\/careerguide\",\"name\":\"Guest Post: The Cross-Browser Compatibility Myth - Simple Programmer\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/#website\"},\"datePublished\":\"2011-03-23T02:57:59+00:00\",\"dateModified\":\"2018-04-13T20:57:47+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/#\\\/schema\\\/person\\\/1abc70edfb189184827740310672de67\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/products\\\/careerguide#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/simpleprogrammer.com\\\/products\\\/careerguide\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/products\\\/careerguide#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/simpleprogrammer.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Guest Post: The Cross-Browser Compatibility Myth\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/#website\",\"url\":\"https:\\\/\\\/simpleprogrammer.com\\\/\",\"name\":\"Simple Programmer\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/simpleprogrammer.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/#\\\/schema\\\/person\\\/1abc70edfb189184827740310672de67\",\"name\":\"John Sonmez\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/dc2f18dfa76e017566ce607de002d7abe4acfd5ec19a6db82c180b00867b8d94?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/dc2f18dfa76e017566ce607de002d7abe4acfd5ec19a6db82c180b00867b8d94?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/dc2f18dfa76e017566ce607de002d7abe4acfd5ec19a6db82c180b00867b8d94?s=96&d=mm&r=g\",\"caption\":\"John Sonmez\"},\"url\":\"https:\\\/\\\/simpleprogrammer.com\\\/author\\\/jsonmez\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Guest Post: The Cross-Browser Compatibility Myth - Simple Programmer","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/simpleprogrammer.com\/products\/careerguide","og_locale":"en_US","og_type":"article","og_title":"Guest Post: The Cross-Browser Compatibility Myth - Simple Programmer","og_description":"This post is a special guest post from my wife, Heather Sonmez, who is an expert on the subject of blackbox automated tests and designing frameworks for them. \u00a0She has designed successful automation frameworks for several companies. \u00a0She deals with software automation and framework design issues on a daily basis, so I thought she might...","og_url":"https:\/\/simpleprogrammer.com\/products\/careerguide","og_site_name":"Simple Programmer","article_published_time":"2011-03-23T02:57:59+00:00","article_modified_time":"2018-04-13T20:57:47+00:00","author":"John Sonmez","twitter_card":"summary_large_image","twitter_misc":{"Written by":"John Sonmez","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/simpleprogrammer.com\/products\/careerguide#article","isPartOf":{"@id":"https:\/\/simpleprogrammer.com\/guest-post-the-cross-browser-compatibility-myth\/"},"author":{"name":"John Sonmez","@id":"https:\/\/simpleprogrammer.com\/#\/schema\/person\/1abc70edfb189184827740310672de67"},"headline":"Guest Post: The Cross-Browser Compatibility Myth","datePublished":"2011-03-23T02:57:59+00:00","dateModified":"2018-04-13T20:57:47+00:00","mainEntityOfPage":{"@id":"https:\/\/simpleprogrammer.com\/guest-post-the-cross-browser-compatibility-myth\/"},"wordCount":878,"commentCount":2,"articleSection":["Automation","BAT","Frameworks","Guest Post","Testing","Web Development"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/simpleprogrammer.com\/products\/careerguide#respond"]}]},{"@type":"WebPage","@id":"https:\/\/simpleprogrammer.com\/guest-post-the-cross-browser-compatibility-myth\/","url":"https:\/\/simpleprogrammer.com\/products\/careerguide","name":"Guest Post: The Cross-Browser Compatibility Myth - Simple Programmer","isPartOf":{"@id":"https:\/\/simpleprogrammer.com\/#website"},"datePublished":"2011-03-23T02:57:59+00:00","dateModified":"2018-04-13T20:57:47+00:00","author":{"@id":"https:\/\/simpleprogrammer.com\/#\/schema\/person\/1abc70edfb189184827740310672de67"},"breadcrumb":{"@id":"https:\/\/simpleprogrammer.com\/products\/careerguide#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/simpleprogrammer.com\/products\/careerguide"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/simpleprogrammer.com\/products\/careerguide#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/simpleprogrammer.com\/"},{"@type":"ListItem","position":2,"name":"Guest Post: The Cross-Browser Compatibility Myth"}]},{"@type":"WebSite","@id":"https:\/\/simpleprogrammer.com\/#website","url":"https:\/\/simpleprogrammer.com\/","name":"Simple Programmer","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/simpleprogrammer.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/simpleprogrammer.com\/#\/schema\/person\/1abc70edfb189184827740310672de67","name":"John Sonmez","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/dc2f18dfa76e017566ce607de002d7abe4acfd5ec19a6db82c180b00867b8d94?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/dc2f18dfa76e017566ce607de002d7abe4acfd5ec19a6db82c180b00867b8d94?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/dc2f18dfa76e017566ce607de002d7abe4acfd5ec19a6db82c180b00867b8d94?s=96&d=mm&r=g","caption":"John Sonmez"},"url":"https:\/\/simpleprogrammer.com\/author\/jsonmez\/"}]}},"_links":{"self":[{"href":"https:\/\/simpleprogrammer.com\/wp-json\/wp\/v2\/posts\/1277","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/simpleprogrammer.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/simpleprogrammer.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/simpleprogrammer.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/simpleprogrammer.com\/wp-json\/wp\/v2\/comments?post=1277"}],"version-history":[{"count":0,"href":"https:\/\/simpleprogrammer.com\/wp-json\/wp\/v2\/posts\/1277\/revisions"}],"wp:attachment":[{"href":"https:\/\/simpleprogrammer.com\/wp-json\/wp\/v2\/media?parent=1277"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/simpleprogrammer.com\/wp-json\/wp\/v2\/categories?post=1277"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/simpleprogrammer.com\/wp-json\/wp\/v2\/tags?post=1277"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}