<?xml version='1.0' encoding='UTF-8'?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-6518319985908136416</atom:id><lastBuildDate>Thu, 07 Apr 2022 03:23:33 +0000</lastBuildDate><category>google chrome</category><category>testing tip</category><title>BugsFollow.Me</title><description>Software, Defects, Thoughts, Life and all around this.</description><link>http://www.bugsfollow.me/</link><managingEditor>noreply@blogger.com (Artsiomi S.)</managingEditor><generator>Blogger</generator><openSearch:totalResults>6</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6518319985908136416.post-8150427277707723727</guid><pubDate>Thu, 20 Apr 2017 10:07:00 +0000</pubDate><atom:updated>2017-04-20T13:07:19.716+03:00</atom:updated><title>What is Selenium WebDriver</title><description>&lt;div class=&quot;graf graf--p&quot; name=&quot;7d87&quot;&gt;If you are just starting looking into Test Automation you must have heard something about Selenium, but not yet sure what it is. Let’s add some context and details to Selenium.&lt;/div&gt;&lt;h2&gt;&lt;br /&gt;&lt;/h2&gt;&lt;h2&gt;How Test Automation is&amp;nbsp;working&lt;/h2&gt;&lt;div class=&quot;graf graf--p&quot; name=&quot;822b&quot;&gt;Test Automation is pretty similar to manual testing and is dead simple. You need to make computer do something automatically. It can be done writing new small programs (scripts) which are called Automated Tests.&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;graf graf--p&quot; name=&quot;2343&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;graf graf--p&quot; name=&quot;2343&quot;&gt;Automated Test is actually a small program — piece of code in some programming language which simulates actions of real user.&lt;/div&gt;&lt;div class=&quot;graf graf--p&quot; name=&quot;76b0&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;graf graf--p&quot; name=&quot;76b0&quot;&gt;If we talk about Web — Automated Test would be mainly interacting with Browser to do something like opening pages, clicking somewhere, etc. And this is where Selenium comes into play.&amp;nbsp;&lt;/div&gt;&lt;h2&gt;&lt;br /&gt;&lt;/h2&gt;&lt;h2&gt;What is&amp;nbsp;Selenium&lt;/h2&gt;&lt;div class=&quot;graf graf--p&quot; name=&quot;b4c7&quot;&gt;Selenium is a set of programming libraries which provides your scripts a way to interact with browser.&lt;/div&gt;&lt;div class=&quot;graf graf--p&quot; name=&quot;201c&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;graf graf--p&quot; name=&quot;201c&quot;&gt;Selenium gives you an ability to:&lt;/div&gt;&lt;ul class=&quot;postList&quot;&gt;&lt;li class=&quot;graf graf--li&quot; name=&quot;6f63&quot;&gt;Open pages&lt;/li&gt;&lt;li class=&quot;graf graf--li&quot; name=&quot;534a&quot;&gt;Finding some elements on a page&lt;/li&gt;&lt;li class=&quot;graf graf--li&quot; name=&quot;ce5f&quot;&gt;Performing various actions over elements like clicking or entering text into a text field&lt;/li&gt;&lt;li class=&quot;graf graf--li&quot; name=&quot;d8e9&quot;&gt;Take a screenshot of what’s displayed in browser&lt;/li&gt;&lt;/ul&gt;&lt;div class=&quot;graf graf--p&quot; name=&quot;ed02&quot;&gt;These actions are basically everything what user can do, so it is sufficient to write good Automated Tests.&lt;/div&gt;&lt;div class=&quot;graf graf--p&quot; name=&quot;d08a&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;graf graf--p&quot; name=&quot;d08a&quot;&gt;Better part of it is that’s all this comes at no cost. Selenium is free and open source.&lt;/div&gt;&lt;div class=&quot;graf graf--p&quot; name=&quot;28a5&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;graf graf--p&quot; name=&quot;28a5&quot;&gt;If you want to know more about Selenium and it’s history you can refer to official website — &lt;a class=&quot;markup--anchor markup--p-anchor&quot; data-href=&quot;http://www.seleniumhq.org/&quot; href=&quot;http://www.seleniumhq.org/&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;seleniumhq.org&lt;/a&gt;. A good place to start is &lt;a class=&quot;markup--anchor markup--p-anchor&quot; data-href=&quot;http://www.seleniumhq.org/docs/01_introducing_selenium.jsp&quot; href=&quot;http://www.seleniumhq.org/docs/01_introducing_selenium.jsp&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;Introduction to Selenium&lt;/a&gt;.&lt;/div&gt;&lt;h2&gt;&lt;br /&gt;&lt;/h2&gt;&lt;h2&gt;What is “WebDriver” part&amp;nbsp;about&lt;/h2&gt;&lt;div class=&quot;graf graf--p&quot; name=&quot;b8ee&quot;&gt;WebDriver brings a bit of confusion when you start learning about Selenium.&lt;/div&gt;&lt;div class=&quot;graf graf--p&quot; name=&quot;6604&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;graf graf--p&quot; name=&quot;6604&quot;&gt;Why Selenium is sometimes called Selenium WebDriver? Because it’s using WebDriver standard underneath to interact with different Browsers.&lt;/div&gt;&lt;div class=&quot;graf graf--p&quot; name=&quot;6d7c&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;graf graf--p&quot; name=&quot;6d7c&quot;&gt;But what is WebDriver standard? It’s a standard developed by creators of Selenium. Now it’s a W3C Standard available here — &lt;a class=&quot;markup--anchor markup--p-anchor&quot; data-href=&quot;https://www.w3.org/TR/webdriver/&quot; href=&quot;https://www.w3.org/TR/webdriver/&quot; rel=&quot;nofollow noopener&quot; target=&quot;_blank&quot;&gt;https://www.w3.org/TR/webdriver/&lt;/a&gt;.&lt;/div&gt;&lt;div class=&quot;graf graf--p&quot; name=&quot;d8e5&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;graf graf--p&quot; name=&quot;d8e5&quot;&gt;This standard describes all the actions which user can perform over a browser and all the ways in which browser can respond.&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;graf graf--p&quot; name=&quot;99f5&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;graf graf--p&quot; name=&quot;99f5&quot;&gt;Given this WebDriver standard is an ideal intermediate level between Selenium libraries and actual browser.&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;graf graf--p&quot; name=&quot;1c39&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;graf graf--p&quot; name=&quot;1c39&quot;&gt;Selenium WebDriver is actually trying to work with something based on WebDriver standard. And here is where some wonderful things come into place — Browser developers (Google, Mozilla, etc.) were willing to support WebDriver standard and provide special versions of their browsers which can be controlled automatically (via WebDriver interface). These special versions of browsers are usually called Drivers.&lt;/div&gt;&lt;div class=&quot;graf graf--p&quot; name=&quot;720a&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;graf graf--p&quot; name=&quot;720a&quot;&gt;Why this concept of WebDriver is good? Because when new browser arises like Edge — we will be able to automate it once it supports WebDriver standard. And no new work will be required from Selenium side.&lt;/div&gt;&lt;div class=&quot;graf graf--p&quot; name=&quot;c567&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;graf graf--p&quot; name=&quot;c567&quot;&gt;This was a great effort by Selenium team to make it all work. Thanks to them and browser developers to let this happen.&lt;/div&gt;&lt;div class=&quot;graf graf--p&quot; name=&quot;f202&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;graf graf--p&quot; name=&quot;f202&quot;&gt;But why selenium is called Selenium WebDriver, can’t is be just Selenium? This is a bit legacy thing. When Selenium was first developed — there were no such thing as WebDriver, it was working very differently. When new version was ready and WebDriver was in place — it was called “Selenium 2”, and sometimes to highlight how version two is different from the first one it’s called “Selenium WebDriver”. There is also a third version of Selenium which is still using WebDriver underneath.&lt;/div&gt;</description><link>http://www.bugsfollow.me/2017/04/what-is-selenium-webdriver.html</link><author>noreply@blogger.com (Artsiomi S.)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6518319985908136416.post-3045997120138297311</guid><pubDate>Tue, 18 Apr 2017 08:15:00 +0000</pubDate><atom:updated>2017-04-18T11:19:28.962+03:00</atom:updated><title>Why do we need a testing framework (Selenium)</title><description>&lt;div class=&quot;graf graf--p&quot; name=&quot;3b10&quot;&gt;When you start learning automation testing in Selenium in any programming language — you will always get to a point when you need some testing framework (at least you will feel this way).&lt;/div&gt;&lt;div class=&quot;graf graf--p&quot; name=&quot;a7ad&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;graf graf--p&quot; name=&quot;a7ad&quot;&gt;But why do we really need a testing framework? Is selenium bad without frameworks?&lt;/div&gt;&lt;h2&gt;&lt;/h2&gt;&lt;h2&gt;What is a testing framework&lt;/h2&gt;&lt;div class=&quot;graf graf--p graf--startsWithDoubleQuote&quot; name=&quot;b49a&quot;&gt;“Framework” is kinda buzzword in testing world. Everyone are looking for one, or looking to create one.&lt;/div&gt;&lt;div class=&quot;graf graf--p&quot; name=&quot;cb6f&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;graf graf--p&quot; name=&quot;cb6f&quot;&gt;Actually what most people are calling a framework is just a set of libraries wrapping Selenium API.&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;graf graf--p&quot; name=&quot;3f86&quot;&gt;It’s not such a big thing as frameworks in a typical software development sense. They are just not so mature, contains just some couple of features, doesn’t imply any rules on how to structure the code.&lt;/div&gt;&lt;h2&gt;&lt;/h2&gt;&lt;h2&gt;Typical features of testing frameworks&lt;/h2&gt;&lt;div class=&quot;graf graf--p&quot; name=&quot;4c3e&quot;&gt;Features of testing frameworks doesn’t vary greatly, usually they just address different areas of software testing and try to ease test development or provide a solution to some routine tasks.&lt;/div&gt;&lt;div class=&quot;graf graf--p&quot; name=&quot;a623&quot;&gt;Features of testing frameworks (in no particular order):&lt;/div&gt;&lt;ul class=&quot;postList&quot;&gt;&lt;li class=&quot;graf graf--li&quot; name=&quot;d981&quot;&gt;&lt;strong class=&quot;markup--strong markup--li-strong&quot;&gt;Reporting &lt;/strong&gt;— many frameworks include beautiful business-ready reports out of the box. It’s good when you have a report which suits your needs, but can be troublesome to modify it later if you will need some extra information in it.&lt;/li&gt;&lt;li class=&quot;graf graf--li&quot; name=&quot;6dc6&quot;&gt;&lt;strong class=&quot;markup--strong markup--li-strong&quot;&gt;Logging &lt;/strong&gt;— most frameworks include detailed logging of actions performed by Selenium API and other things. It’s good in any way if coverage is good enough. It can ease debugging and support of tests. Sometimes logs also include screenshots or video of test execution.&lt;/li&gt;&lt;li class=&quot;graf graf--li&quot; name=&quot;dac7&quot;&gt;&lt;strong class=&quot;markup--strong markup--li-strong&quot;&gt;Validations &lt;/strong&gt;— some frameworks address how you validate things in tests. Proper validations may ease the Reporting and Logging mentioned above.&lt;/li&gt;&lt;li class=&quot;graf graf--li&quot; name=&quot;fba1&quot;&gt;&lt;strong class=&quot;markup--strong markup--li-strong&quot;&gt;Page and Elements handling&lt;/strong&gt; — some frameworks dictate how pages and elements should be organized. This is not a technical decision, but rather a try to structure and organize the tests. Sometimes it makes sense, but some decisions are very subjective and represents a specific opinion of a framework’s author.&lt;/li&gt;&lt;li class=&quot;graf graf--li&quot; name=&quot;d5c0&quot;&gt;&lt;strong class=&quot;markup--strong markup--li-strong&quot;&gt;Waits and AJAX handling&lt;/strong&gt; — some frameworks try to give you all-in-one solution to all the AJAX and async moments in tests. There is no silver bullet, so if your framework tells it has one — be careful with this. More mature frameworks doesn’t give you all-in-one solution, but rather give you good opportunities to make Waiting easier.&lt;/li&gt;&lt;li class=&quot;graf graf--li&quot; name=&quot;ea35&quot;&gt;&lt;strong class=&quot;markup--strong markup--li-strong&quot;&gt;Browsers handling&lt;/strong&gt; — most frameworks try to ease working with different browsers. And many of them did a great job with this. But still sometimes you will be in situations when you will need to add something custom to make it work everywhere. Nothing bad about frameworks, but just remember — that you need to do something on your own and not depend on others.&lt;/li&gt;&lt;li class=&quot;graf graf--li&quot; name=&quot;9a0f&quot;&gt;&lt;strong class=&quot;markup--strong markup--li-strong&quot;&gt;Locating elements &lt;/strong&gt;— some frameworks question the way you locate the elements and try to give you their own approach on this. Again this kind of features is pretty subjective and won’t suit everyone’s needs.&lt;/li&gt;&lt;li class=&quot;graf graf--li&quot; name=&quot;ade0&quot;&gt;&lt;strong class=&quot;markup--strong markup--li-strong&quot;&gt;Parallel runs&lt;/strong&gt; — some frameworks state that you can run tests in parallel and provide you some things to do this. Parallelization is a tricky area. Usually it’s more about Continuous integration and the way you run the tests rather than Testing frameworks.&lt;/li&gt;&lt;/ul&gt;&lt;h2&gt;&lt;/h2&gt;&lt;h2&gt;The need in testing framework&lt;/h2&gt;&lt;div class=&quot;graf graf--p&quot; name=&quot;0ee3&quot;&gt;There is no vital need in testing frameworks.&lt;/div&gt;&lt;div class=&quot;graf graf--p&quot; name=&quot;eb7c&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;graf graf--p&quot; name=&quot;eb7c&quot;&gt;All the mentioned features are not a vital things to include in your tests, they just cover something which you may need to do yourself.&lt;/div&gt;&lt;div class=&quot;graf graf--p&quot; name=&quot;1352&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;graf graf--p&quot; name=&quot;1352&quot;&gt;So the frameworks won’t make your tests better, they just speed up your work and provide some specific solutions to everyone’s problems.&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;graf graf--p&quot; name=&quot;fdba&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;graf graf--p&quot; name=&quot;fdba&quot;&gt;Selenium is not bad in any way and doesn’t require you to use frameworks. Actually all the interaction between the browser and the pages is performed by Selenium and not the frameworks. It means that there are no any advantages on using one framework over another in terms of interaction with pages — they all use the same Selenium API underneath.&lt;/div&gt;&lt;div class=&quot;graf graf--p&quot; name=&quot;447f&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;graf graf--p&quot; name=&quot;447f&quot;&gt;So what to do if you start learning automation and are thinking about which framework to choose? My bet is — get anything popular and wide-spread and start with it. Once you will meet some problems you can start looking into changing the framework or writing your own.&lt;/div&gt;&lt;div class=&quot;graf graf--p graf--empty&quot; name=&quot;aa02&quot;&gt;&lt;br /&gt;&lt;/div&gt;</description><link>http://www.bugsfollow.me/2017/04/why-do-we-need-testing-frameworks.html</link><author>noreply@blogger.com (Artsiomi S.)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6518319985908136416.post-8322473334958285391</guid><pubDate>Fri, 03 Apr 2015 15:23:00 +0000</pubDate><atom:updated>2015-04-03T18:23:34.286+03:00</atom:updated><title>Approaches to handling AJAX in Web Automation (Selenium)</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;Unfortunately pretty much places in web applications automation are based on &quot;Magic&quot;. What do I mean by saying magic?&lt;br /&gt;&lt;br /&gt;Example of Magic:&lt;br /&gt;&lt;ol style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Test is failing (or some operation is failing) and you don&#39;t know why&lt;/li&gt;&lt;li&gt;You are trying something - and is works&lt;/li&gt;&lt;li&gt;BUT you can&#39;t explain why the thing you done helps to fix the situation, and is it reliable or not&lt;/li&gt;&lt;/ol&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So, talking about JS/AJAX handling - it&#39;s mostly based on Magic for now. Nobody knows how to handle it properly, neither I do.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In this article I&#39;ll try to explain how to get rid of Magic in JS/AJAX handling as much as possible. Just theory, without code examples.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/h2&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Why do we need to handle JS / AJAX in specific way?&lt;/h2&gt;&lt;div&gt;Page loading can be divided into two parts: synchronous ans asynchronous.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Synchronous:&amp;nbsp;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Receiving most of the page content from server&lt;/li&gt;&lt;li&gt;All the elements are added&quot;at once&quot;&lt;/li&gt;&lt;li&gt;Basically it is what happens before &quot;loading&quot; indicator is stopped in browser (usually at the top of the browser UI)&lt;/li&gt;&lt;li&gt;&lt;b&gt;How to handle:&lt;/b&gt;&lt;/li&gt;&lt;ul&gt;&lt;li&gt;In most cases we don&#39;t need to handle this specifically, because WebDriver waits for page to load before any action on elements. However some exceptions apply. I don&#39;t know whether the list of exceptions exist - so you probably will find it out the hard way.&lt;/li&gt;&lt;li&gt;Since all the elements are drawn (rendered) at once - to handle synchronous loading - you need to determine unique element on the page you want to work with.&amp;nbsp;&lt;/li&gt;&lt;ul&gt;&lt;li&gt;By waiting for this unique element - you will be sure that all synchronous elements are loaded as well.&amp;nbsp;&lt;/li&gt;&lt;li&gt;Element needs to be unique because otherwise your test may find this element on previous page and think that loading is already completed.&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Asynchronous&lt;/b&gt;:&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Any client-side processing - JS, AJAX&lt;/li&gt;&lt;li&gt;This may happen at any time, but usually is tied to some user interactions&lt;/li&gt;&lt;li&gt;Each element is added separately - after the processing is completed&lt;/li&gt;&lt;li&gt;&lt;b&gt;How to handle:&lt;/b&gt;&lt;/li&gt;&lt;ul&gt;&lt;li&gt;Each case of asynchronous loading need to be handled separately.&lt;/li&gt;&lt;li&gt;More details on approaches below.&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;div&gt;&lt;br /&gt;As you may see the main difference here is adding of elements (adding to DOM).&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;How JS is related here? - JS just is a way to add element on client-side (in browser).&lt;/div&gt;&lt;div&gt;How AJAX is related here? - AJAX gets some additional info from server, to be added on page via JS&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/h2&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;How Asynchronous loading is handled?&lt;/h2&gt;&lt;div&gt;I know following approach, which will be described in more details below:&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Use Sleep to pause execution&lt;/li&gt;&lt;li&gt;Use ClickWithMouseOver or some other Magic method&lt;/li&gt;&lt;li&gt;Use JQuery or JS Event-based waiting&lt;/li&gt;&lt;li&gt;Use specific waiting for each case&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;Use Sleep to pause execution&lt;/b&gt;&lt;/h3&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;There is some element which will be added now? Ok, I&#39;ll wait 5 sec for it, just like human do. Seems reasonable, but in fact it&#39;s not.&amp;nbsp;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This is the most wide-spread approach, and in fact the most straight-forward.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;Human will stop waiting after he sees the element appeared. And if element is not appearing withing 5 seconds - he can wait more.&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Sleep approach - instead determines some time to wait, This timeout time may be fixed (hopefully) or vary by each place.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Bad:&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;It&#39;s slow. Every problem place will be just waiting.&lt;/li&gt;&lt;li&gt;It&#39;s not reliable. If test will still fail - the only thing you can do - increase Sleep time.&lt;/li&gt;&lt;li&gt;It&#39;s not effective.&lt;b&gt; &lt;/b&gt;Your element may appear in 2 seconds, but you will still wait for full 5 seconds before continuing.&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;b&gt;Good:&lt;/b&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;It&#39;s dead simple.&lt;/li&gt;&lt;li&gt;It&#39;s cheap to implement.&lt;b&gt; &lt;/b&gt;(not counting test support time here)&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;Fortunately many people understand drawbacks of this approach, and try to eliminate it. But in some complex cases may fallback to this.&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;Use ClickWithMouseOver or some other Magic method&lt;/h3&gt;&lt;div&gt;The second most used approach is pure Magic.&amp;nbsp;&lt;/div&gt;&lt;div&gt;The most simple example:&lt;/div&gt;&lt;div&gt;&lt;ol style=&quot;text-align: left;&quot;&gt;&lt;li&gt;You have a test case which was working, but now it fails on clicking a button.&lt;/li&gt;&lt;li&gt;You run it locally - and it passes only sometimes (40% of executions).&lt;/li&gt;&lt;li&gt;You have hard time thinking how may this happen.&lt;/li&gt;&lt;li&gt;You try everything and occasionally try Clicking with Mouse over the button&lt;/li&gt;&lt;li&gt;Hurray! it helps - test passes 100% of execution.&lt;/li&gt;&lt;/ol&gt;&lt;div&gt;Do you do everything right here? Seems legit. But it may be not.&amp;nbsp;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;In place of Clicking with Mouse over can be some other method which helps, like:&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Waiting for some element on page before Click&lt;/li&gt;&lt;li&gt;Checking of button attributes before Click&lt;/li&gt;&lt;li&gt;Even some kind of Waiting for AJAX (based on JQuery.active), more details in next section&lt;/li&gt;&lt;li&gt;Checking for some info in DB before click&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;What is common for all this functions? - They all are not doing anything helpful or needed for the test case.&lt;/div&gt;&lt;/div&gt;&lt;div&gt;How the hell then they helps up to pass the test? - They introduce some kind of delay. It may be even 0.5s to move the mouse pointer over the button, or to process some info from DB.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;It appears that this approach is just a kind of unintentional Sleep calling. Instead of waiting for some specific time - you slow down your test just enough to make it passed.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Bad:&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;People usually don&#39;t understand when they do this&lt;/li&gt;&lt;li&gt;Extra unneeded actions performed&lt;/li&gt;&lt;li&gt;It&#39;s highly not stable, if test will fail later - you will just look for other Magic method which helps&lt;/li&gt;&lt;li&gt;You have confidence that you&#39;re not using sleeps, but in fact - you are&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Good:&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Tests are a bit faster then with using Sleeps&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;I won&#39;t recommend this approach in any cases. Even using Sleeps is better that this one - because you are using Sleep intentionally, without any Magic.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;Use JQuery or JS Event-based waiting&lt;/h3&gt;&lt;div&gt;Most of the sites use JQuery for different reasons, including performing AJAX calls. But this is not the panacea. Developers can implement AJAX without using JQuery.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If your site is using JQuery for AJAX - you can use JQuery to see whether AJAX call is ended or not. Seems ideal. But again it&#39;s not.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;There are two approaches for handling JQuery AJAX calls ending, let&#39;s stop on them briefly:&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;.jQuery.active == 0&lt;/li&gt;&lt;ul&gt;&lt;li&gt;This counter shows how many requests are &quot;in progress&quot; now&lt;/li&gt;&lt;li&gt;This is not working, because there may be gaps between different requests.&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;ajaxStars and ajaxStop events&lt;/li&gt;&lt;ul&gt;&lt;li&gt;These events are triggered on Start and Stop of each request accordingly.&lt;/li&gt;&lt;li&gt;These events are commonly used to display &quot;loading&quot; icon&lt;/li&gt;&lt;li&gt;This is not working for the same reasons - there may be gaps between requests. Getting back to &quot;loading&quot; icon - you may see how it&#39;s flickering sometimes - this is a visualization of gaps between the requests.&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Bad:&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Tied to site implementation. May be not suitable for everyone&lt;/li&gt;&lt;li&gt;Gaps between requests can be handled correctly. Maybe only with some fallbacks to timeouts and sleeps. Like assuming that gap won&#39;t be longer than 3 seconds, and wait up to 3 seconds after active=0 before proceeding.&lt;/li&gt;&lt;li&gt;Involves low-level JS communication with site&lt;/li&gt;&lt;li&gt;A bit more complex to implement than previous approaches&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Good:&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;It&#39;s slightly more reliable than previous approaches&lt;/li&gt;&lt;li&gt;It may work very well for sites with small amount of AJAX (when there is only 1 consequent request and may not be gaps)&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;Use specific waiting for each case&lt;/h3&gt;&lt;div style=&quot;text-align: left;&quot;&gt;The most complex and the most suitable approach in my opinion.&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;I believe that you can&#39;t handle all the JS/AJAX cases in one way.&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;Instead of trying to achieve it - dig deeper in each specific AJAX call.&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;AJAX calls usually are tend to get some info from server, that means that as a result - something new will be displayed on page. You need to find out which new element will be displayed the last - and wait for this specific element.&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;b&gt;Bad:&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Digging into details of AJAX calls may be complex&lt;/li&gt;&lt;li&gt;Code base is significantly bigger - since you write separate waiting for each place&lt;/li&gt;&lt;li&gt;Implementation may change, and you will need to support waiting&lt;/li&gt;&lt;li&gt;It touches pretty low-level interactions of elements on page&lt;/li&gt;&lt;li&gt;Implementations of this is pretty time consuming&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;b&gt;Good:&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;You perfectly know how it works in every case. Finally no Magic here&lt;/li&gt;&lt;li&gt;No sleeps or timeouts involved, you wait for exact condition&lt;/li&gt;&lt;li&gt;It&#39;s stable to application slow downs (due to some performance issues or high-load)&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;In summary&lt;/h2&gt;&lt;div&gt;I hope this article gives you more detailed view on AJAX in Web Applications and how to handle it in Automated testing.&lt;/div&gt;&lt;div&gt;Please post any other approaches in comments.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;</description><link>http://www.bugsfollow.me/2015/04/approaches-to-handling-ajax-in-web.html</link><author>noreply@blogger.com (Artsiomi S.)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6518319985908136416.post-1888067924832209123</guid><pubDate>Thu, 02 Apr 2015 09:30:00 +0000</pubDate><atom:updated>2015-04-02T14:15:44.080+03:00</atom:updated><title>Random Data in Test Automation</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;Using random data can be pretty tricky. As always there are two types of people - who uses random a lot, and who don&#39;t.&lt;br /&gt;&lt;br /&gt;Let&#39;s compare these two ways.&lt;br /&gt;&lt;br /&gt;&lt;table id=&quot;hor-minimalist-b&quot; style=&quot;width: 100%;&quot;&gt;&lt;thead&gt;&lt;tr&gt;&lt;th style=&quot;text-align: center;&quot;&gt;Random &lt;/th&gt;&lt;th style=&quot;text-align: center;&quot;&gt;No Random &lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;Every run you get a new set of data to use&lt;/li&gt;&lt;li&gt;Coverage is increasing with each test run&lt;/li&gt;&lt;li&gt;You don&#39;t need to think about duplicates in data, assuming random is working well&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;Every run is on same (or identical) set of data&lt;/li&gt;&lt;li&gt;Pesticide Paradox in place&lt;/li&gt;&lt;li&gt;You need to handle duplicates - delete data from previous runs, or in some other way&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;From the table above using Random seems to be the best choice, but there are some pitfalls.&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/h3&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;Tests are not repeatable&lt;/h3&gt;&lt;div&gt;One of the main ideas about automated testing is - tests should be repeatable. This means that no matter how many times you run the same test against the same system - it should provide the same outcome.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;With using random values - this is not the case. You always run slightly different test case, and if some value appears to be buggy - you will see this only in logs, and won&#39;t be able to run the automated test on the same values again.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Tips:&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Even though your tests are using random data - leave an option to provide specific data for test run.&lt;/li&gt;&lt;li&gt;Write separate test cases with specific data for found bugs. This will help you to find regressions.&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/h3&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;Random generated value needs to be in the same Equivalence class&lt;/h3&gt;&lt;/div&gt;&lt;div&gt;If you don&#39;t know about partitions - please read about Equivalence Partitioning. There is a good article about it on Software Testing Class - &lt;a href=&quot;http://www.softwaretestingclass.com/boundary-value-analysis-and-equivalence-class-partitioning-with-simple-example/&quot;&gt;&amp;nbsp;Boundary Value Analysis and Equivalence Class Partitioning With Simple Example&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Let&#39;s assume that we need to test checkout in online shop - we need to select a product, and enter quantity of items we want to buy. And the requirement is - nobody can order more than 10 pcs.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So valid values will be 1-10 items, and invalid values - below or equal to 0, above 10.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;As you see we can&#39;t just put random number in here - we need to limit randomness range.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Your testing solution need to be able to generate two kind of random quantity values - valid and invalid.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;And for such a simple case it sounds easy and obvious. But when it come to something more complex (for example Full name for a person, Address or Filename) - preparing random data can be troublesome.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Tips:&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Randomly generate only valid values for positive cases, you probably have some rules for valid values and you can stick to them&lt;/li&gt;&lt;li&gt;Use non-random values for negative cases - range of invalid values is usually far bigger than valid ones, while outcome of test coverage is pretty small&lt;/li&gt;&lt;li&gt;Separate generation of random data from other code. If you will have some separate Class/Generator which will contain all the rules - it will be much easier for you to modify the rules&lt;/li&gt;&lt;/ul&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/h3&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;DB overload with randomized test data&lt;/h3&gt;&lt;div&gt;If you don&#39;t care about clearing you data - you will soon be overloaded.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So no matter that random values give you an opportunity to bypass duplicates validation - you need to keep in mind this validation, and clear the created data.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/h3&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;Timestamp is not effectively random/unique&lt;/h3&gt;&lt;div&gt;Let&#39;s say you need a Last name - just add an UNIX timestamp to the end and it will be random each time. Easy and seems unique. But in fact it&#39;s not.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;UNIX timestamp is unique only across one machine for executing tests, without any changes of time and timezone (including DST). But in automation we usually run the tests across different machines - so timezones can overlap and provide duplicates for our &quot;unique&quot; values.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Tips:&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Use GUID or some similar mechanism to maintain uniqueness&lt;/li&gt;&lt;li&gt;If your random value contains some illegal characters (for example dashes in GUID) - just replace them with some specific character. The value will still be unique.&lt;/li&gt;&lt;li&gt;If you are still using Timestamps - don&#39;t try to truncate or process them in any way, because any processing will limit it&amp;nbsp;uniqueness even more.&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/h3&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;In summary&lt;/h3&gt;&lt;div&gt;If you are not concerned about Pesticide Paradox - I recommend you to not deal with Random data in your tests, or use it as least as possible. This way you won&#39;t need to handle all the things mentioned above, but you will need to implement some mechanism of clearing created data.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description><link>http://www.bugsfollow.me/2015/04/random-data-in-test-automation.html</link><author>noreply@blogger.com (Artsiomi S.)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6518319985908136416.post-954751479312881597</guid><pubDate>Tue, 31 Mar 2015 17:54:00 +0000</pubDate><atom:updated>2015-03-31T20:54:25.959+03:00</atom:updated><title>Why developers are so paranoid about failing Integration tests and Why this is not a problem</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;When it comes to developers talking about Web Integration tests - you may hear something like &quot;Test should not fail if I move this button&quot; or &quot;If the text on the button changes slightly - test should still pass&quot;&lt;br /&gt;&lt;br /&gt;But from my point of view it&#39;s ok to fail test because of that. And I would even believe failing test more than passing one.&lt;br /&gt;&lt;br /&gt;For a long time I cannot understand the reason of this misunderstanding. And today while reading a book on unit testing - I finally got it.&lt;br /&gt;&lt;br /&gt;tl;dr changes in Web Page are more sensitive than changes in API&lt;br /&gt;&lt;br /&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;When you talk about unit testing you really don&#39;t want your tests to break as a result of refactoring. It&#39;s a well-known fact, and I won&#39;t argue with that.&lt;br /&gt;It&#39;s so because unit tests are working with pretty specific interface. And changes in interface will be caught by compiler - tests wont compile.&lt;br /&gt;&lt;br /&gt;Back to Web Integration tests - we don&#39;t have such a detailed interface to interact with. Our accessible interface is pretty wide - whole page with all the positions, images, animations and so on.&lt;br /&gt;Also we don&#39;t have a compiler to check all the bindings to an interface (Locators for elements) are suitable for us to interact with.&lt;br /&gt;&lt;br /&gt;&lt;table id=&quot;hor-minimalist-b&quot; style=&quot;width: 100%;&quot;&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;&lt;br /&gt;&lt;/th&gt;&lt;th&gt;&lt;b&gt;Communication &lt;br /&gt;interface&lt;/b&gt;&lt;/th&gt;&lt;th&gt;&lt;b&gt;Entity&lt;/b&gt;&lt;/th&gt;&lt;th&gt;&lt;b&gt;Properties &lt;br /&gt;(non-functional)&lt;/b&gt;&lt;/th&gt;&lt;th&gt;&lt;b&gt;Who is affected&lt;/b&gt;&lt;/th&gt;&lt;th&gt;&lt;b&gt;Price of unexpected&lt;br /&gt;interface changes&lt;/b&gt;&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;Unit Test&lt;/b&gt;&lt;/td&gt;&lt;td&gt;API &lt;br /&gt;(closed or open)&lt;/td&gt;&lt;td&gt;Method&lt;/td&gt;&lt;td&gt;Method name, Parent service, Method parameters&amp;nbsp;&lt;/td&gt;&lt;td&gt;Developers, Tests&lt;/td&gt;&lt;td rowspan=&quot;2&quot;&gt;Decide yourself&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;Integration Test&lt;/b&gt;&lt;/td&gt;&lt;td&gt;Web Page&lt;/td&gt;&lt;td&gt;Element on page (field, label, image, etc.)&lt;/td&gt;&lt;td&gt;Position on page (in DOM), any style related info (size, color, etc), text content, value. etc&lt;/td&gt;&lt;td&gt;End users, Tests&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;So moving back to the button &amp;nbsp;- it is in fact a change in communication interface between a Web Page and Web Integration test.&lt;br /&gt;&lt;br /&gt;We have &lt;b&gt;two options&lt;/b&gt; how to work with it:&lt;br /&gt;&lt;ol style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;b&gt;Ignore the change&lt;/b&gt;&lt;br /&gt;we can do this by making very narrow Locator for an element - which won&#39;t &amp;nbsp;touch anything except the button itself (most probably by some unique button id)&lt;/li&gt;&lt;li&gt;&lt;b&gt;Fail the test &lt;/b&gt;&lt;br /&gt;we can write a bit broader Locator - which will know some more info about the button (text, siblings, etc.)&lt;/li&gt;&lt;/ol&gt;&lt;h4 style=&quot;text-align: left;&quot;&gt;Let&#39;s take look at advantages:&lt;/h4&gt;&lt;ol style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Ignore the change&lt;/li&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Advantages&lt;/li&gt;&lt;ul&gt;&lt;li&gt;We can change anything about the button (refactor) except of it&#39;s functionality and unique id&lt;/li&gt;&lt;li&gt;Tests will fail only on functional defects&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;Disadvantages&lt;/li&gt;&lt;ul&gt;&lt;li&gt;Developers need to provide unique id&#39;s for all the elements, and maintain it through the development process&lt;/li&gt;&lt;li&gt;Button may change it&#39;s place (change interface) and we actually won&#39;t know about this&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;li&gt;Fail the test&lt;/li&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Advantages or Disadvantages (depending on point of view)&lt;/li&gt;&lt;ul&gt;&lt;li&gt;Tests will fail on interface changes&amp;nbsp;&lt;/li&gt;&lt;li&gt;Tests will need to be fixed by human in case of changes&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ol&gt;&lt;br /&gt;&lt;h4 style=&quot;text-align: left;&quot;&gt;In summary&amp;nbsp;&lt;/h4&gt;&lt;div&gt;It&#39;s totally up to you to determine the price of unexpected interface changes.&amp;nbsp;&lt;/div&gt;&lt;div&gt;Since there is no automatic way to check that these changes are valid - I think it&#39;s ok to fail the test, and let the human decide whether that change was expected. With a good approach Web Automation you will only need to make changes in one place (update one Locator) which is pretty quick, but in the same time - you become a little more confident in your test results.&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;/div&gt;</description><link>http://www.bugsfollow.me/2015/03/why-developers-are-so-paranoid-about.html</link><author>noreply@blogger.com (Artsiomi S.)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6518319985908136416.post-1206575274866270366</guid><pubDate>Mon, 15 Apr 2013 06:36:00 +0000</pubDate><atom:updated>2017-04-16T16:05:01.647+03:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">google chrome</category><category domain="http://www.blogger.com/atom/ns#">testing tip</category><title>Testing tip: Google Chrome clearing cache/cookies with a new Chrome User</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;While testing Web Applications we can frequently face problems related to caching or some old cookies.&lt;br /&gt;&lt;br /&gt;The easiest way to clean them in Google Chrome is to use Ctrl+Alt+Delete key combination (or menu Tools -&amp;gt; Clear browsing data...): it will clean all the cookies entirely. And it works in most cases. &lt;br /&gt;&lt;br /&gt;But what if you don&#39;t want to lose all of your cookies (especially if you use Chrome for your personal needs)? You have two options here:&lt;br /&gt;&lt;ol style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Use incognito mode.&amp;nbsp;&lt;/li&gt;&lt;ul&gt;&lt;li&gt;For this press Ctrl+Shift+N key combination. In this mode you won&#39;t have any cache or cookies in place and they won&#39;t be saved at the end of session as well.&lt;/li&gt;&lt;li&gt;For mode details you can refer official article - &lt;a href=&quot;http://support.google.com/chrome/bin/answer.py?hl=en&amp;amp;answer=95464&quot;&gt;Incognito mode&lt;/a&gt;.&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;Create new Google Chrome user and clear everything (or just cookies) for him.&amp;nbsp;&lt;/li&gt;&lt;ul&gt;&lt;li&gt;In this way cookies won&#39;t be cleared at the end of session, so you may continue your work the next day.&lt;/li&gt;&lt;li&gt;For details on creating new user you can refer official article - &lt;a href=&quot;http://support.google.com/chrome/bin/answer.py?hl=en&amp;amp;answer=2364824&quot;&gt;Manage multiple users on Chrome&lt;/a&gt;.&lt;/li&gt;&lt;li&gt;User needs to be created only one time, later you can just switch to it and clear.&lt;/li&gt;&lt;/ul&gt;&lt;/ol&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Personally I prefer 2nd option with new user.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Good luck guys, hopefully this simple tip will be helpful to someone.&lt;/div&gt;&lt;/div&gt;</description><link>http://www.bugsfollow.me/2013/04/testing-tip-google-chrome-clearing.html</link><author>noreply@blogger.com (Artsiomi S.)</author></item></channel></rss>