Posts

Showing posts with the label Selenium

Coypu - magic for Selenium

Image
Coypu is an advanced wrapper for Selenium. Coypu supports browser automation in .Net to help make tests readable, robust, fast to write and less tightly coupled to the UI. If your tests are littered with sleeps, retries, complex XPath expressions and IDs dug out of the source with FireBug then Coypu might help. As coypu has evolved over a period of time, the tool understood the pain points of selenium testers, hence you don’t really have to think of Creating browser object and working with different browsers Finding controls by complex Xpaths, CSS etc Coypu is A robust wrapper for browser automation tools on .Net, such as Selenium WebDriver that eases automating ajax-heavy websites and reduces coupling to the HTML, CSS & JS A more intuitive DSL for interacting with the browser in the way a human being would, inspired by the ruby framework Capybara -  http://github.com/jnicklas/capybara install nuget package  Install-Package Coypu visit https...

Google has implemented a headless option for Chrome

New Headless Chrome With Selenium WebDriver So if you hadn't heard, Google has implemented a headless option for Chrome. This will be included from version 59, however you can download it now and a play using the Canary install. So I did just that. Happy testing!

Exploring Gwen Continued

Image
Continuing from my previous post   and after attending the meetup last evening I decided to put in a few hours to see what the tool had to offer. Opensource is wonderful and when it's in the test automation space and from the city you live in it gets even better! The tool is quite intriguing. Let's explore: Github page:  https://github.com/gwen-interpreter/gwen-web See also: Wiki FAQ Blog Install by downloading the zip or using maven:  https://github.com/gwen-interpreter/gwen-web/wiki/Installation Add the gwen.properties file in the users home directory This makes it a lot more easier to use. Here are a list of supported properties:  http://htmlpreview.github.io/?https://github.com/gwen-interpreter/gwen-web/blob/master/docs/conf/gwen-web-settings.html Choose the browser from the properties file Use the -r option to create reports Moore options here  https://github.com/gwen-interpreter/gwen-web/wiki/Gwen-Web-User-Guide Use th...

Exploring Gwen

Image
Gwen Stefani! Not really :) Gwen: The tool that claims to reduce the development effort when testing using selenium in a BDD(Gherkin) fashion. Attending a meetup by the developer(Branko Juric) himself here Quoting the details: " Automating tests with Selenium WebDriver is a very developer centric activity. But what if you could express the expected behavior of a feature in a standard business language instead and have an interpreter translate and evaluate it for you? This session will introduce and demonstrate an open source automation tool called Gwen that allows you to compose executable tests in a way that frees you from the development concerns typically associated with automation. It will also show you how Gwen can help BDD practices and Agile teams rapidly accelerate their UI testing. As a user of this tool, you no longer need to write any code that interacts with Selenium, develop any page objects, or build any test frameworks at all. " I thought let me...

WebDriverManager - Solution to the selenium binaries

Image
What is WebDriverManager ? Problem:   In order to use some browsers (for example  Chrome , Internet Explorer ,  Opera ,  Microsoft Edge ,  PhantomJS , or  Marionette ) you need to download a binary which allows WebDriver to handle the browser. In addition, the absolute path to this binary must be set as Java variables, as follows: System . setProperty( " webdriver.chrome.driver " , " /absolute/path/to/binary/chromedriver " ); System . setProperty( " webdriver.opera.driver " , " /absolute/path/to/binary/operadriver " ); System . setProperty( " webdriver.ie.driver " , " C:/absolute/path/to/binary/IEDriverServer.exe " ); System . setProperty( " webdriver.edge.driver " , " C:/absolute/path/to/binary/MicrosoftWebDriver.exe " ); System . setProperty( " phantomjs.binary.path " , " /absolute/path/to/binary/phantomjs " ); System . setProperty( " webdriver.gecko.driver " , ...

Marionette ?

Image
Background: Mozilla has been working on a project called Marionette which will become a future version of FirefoxDriver. Official link -  https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette Read more here  http://www.theautomatedtester.co.uk/blog/2012/marionette-the-future-of-firefoxdriver-in-selenium.html Now called the GeckoDriver https://github.com/mozilla/geckodriver If you want to perform UI tests with browser chrome or content, Marionette is the tool you're looking for! Using Marionette with Webdriver -  https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette/WebDriver Future: Marionette will be turned on by default from Selenium 3 Ideally when Firefox 52 comes around you will just update to Selenium 3 Happy Testing!

The weird reason I learnt about Docker: Video recording embedded in Selenium Grid reports

Image
From my earlier post " Docker + Compose + Selenium Grid = Automation awesomeness! " you would have seen that "video recording" was the reason that made me stumble upon Docker. So what options do we have when we want to accomplish videos embedded in our html report when playing with Selenium Grid. vnc2flv Monte avconv Here is a docker image that supports vnc recording:  https://github.com/rnorth/vnc-recorder Another really good docker image with selenium grid sample tests:  https://github.com/sskorol/docker-selenium-grid The recording option used here is avconv: Which is a child of ffmpeg the only one that supports mp4 format Therefore can be easily attached to a HTML5 webpage To read more there is an excellent blog poast from the github page:  http://qa-automation-notes.blogspot.com.au/2016/04/docker-selenium-and-bit-of-allure-how.html Other Docker images that support windows and Unix: https://github.com/ozzyjohnson/docker-ffmpeg-w...

Docker + Compose + Selenium Grid = Automation awesomeness!

Image
I have been trying to get my hands dirty with Docker and Selenium for a while. Finally what inspired me was a recent meetup where I saw some cool test automation reporting frameworks. No I did not see Docker there, but when I researched about Allure the test reporting framework I stumbled upon this cool video where the developer has used Docker Selenium and Allure: Why Selenium Grid & Docker? If you have been through the journey of CI (continuous integration), as an automation engineer you would know the challenges of building a reliable framework is time consuming. This concept has revolutionized our way of thinking of how you build a selenium Grid, no more config mgmt/provisioning machines. All you need is a VM that can run the docker images as a container. Contributors to this project who have made it a reality: Matt Smith Leo Galluci  Selenium Grid Selenium grid has been there for a while and matured with time. What it does really well ...

Automate Android native applications by installing the apk file on your PC / without the need of a mobile phone

Image
Problem:  Need for automating an android application using Appium/Selenium but without emulators and without a mobile device Solution:   Install android app inside chrome as an extension! hOW? Prereq : Chrome 37+ for the solution to work! How this works? The App Runtime for Chrome (or ARC) is the piece of software that allows Android apps to run in Chrome. In the same way that ART (and the older Dalvik ) currently run Android apps in Android itself. What we will need? ARChon Custom Runtime : ARC is officially only designed for Chrome OS at the moment. To get around this, developer vladikoff created the ARChon Custom Runtime, which not only allows Windows, OS X, and Linux to run Android apps, but also removes the limit on how many can be run. Unpacked Extension : Extensions normally come from the Chrome Web Store or prepackaged in a .CRX file. For the purposes of Android apps, we're going to use unpacked extensions. These are folders that contain ...

Repost - Notes: Selenium 3, the Spec, and Onwards by Simon Stewart

Image
Notes: Selenium 3, the Spec, and Onwards by Simon Stewart Title : Selenium 3, the Spec, and Onwards Speaker : Simon Stewart, Selenium Project Lead Host : Applitools Date : Wed. May 25, 2016 @ 1:00 PM EDT Duration : 60 minutes Summing up Simon's Webinar: Selenium 3 ( no release date given ) will be a removal of all old Selenium RC code into a legacy library called "leg-RC". Selenium 4 will move closer to the new W3C WebDriver Protocol they have been pushing for. Selenium 5 will be the full W3C WebDriver. Before that information was given at the end of the talk, Simon took a long walk down Memory Lane... How Selenium Started Jason Huggins (  @hugs  ) at the consulting company, ThoughtWorks, was in Tech Support working on a new web application to track time and expenses. Jason would fix one bug only to have it appear in another browser. He saw Ward Cunningham FIT ( Framework for Integrated Test ). Jason took this idea and realized that all browsers handled HT...

Selenium 3.0 will be out soon!

Image
For anyone who is interested: http://lp.applitools.com/selenium3/ In 2016, the Selenium Project is working hard to (finally!) ship 3.0. Join Simon Stewart on May 25, and discover: What will this release contain What impact will it have on your test runs How can you preserve your existing investment in tests using the Selenium WebDriver APIs, and your even older RC tests Looking forward, when will the W3C spec be complete And what can we expect from Selenium 4 Speaker: Simon Stewart At ThoughtWorks, Simon invented WebDriver. At Google, he became the lead of the Selenium project and built the infrastructure required to run millions of browser-based tests every day. At Facebook, Simon advocated for a monorepo, setup the mobile end-to-end testing frameworks, and lead the Buck build tool team, all of which helped slash the time from code to release.

Open Source Test Automation Frameworks

Image
Every-time I read Joe Colantonio's posts I learn something new and this time it was a newbie called Gauge. If you don't know what it is here are the 6 opensource frameworks Joe talks about: Serenity (Formally Thucydides) Robot Framework RedwoodHQ Sahi Galen  Framework Gauge Update:  Two more to the list: An old one  Open2Test New:  Extensive Testing Further Reading:  http://www.joecolantonio.com/2016/05/10/6-open-source-test-automation-frameworks-need-know/

Tips for faster test automation - Selenium

Image
Here is an excellent article on how we can have efficient test scripts in the selenium world Use few and fast locators Use only Explicit waits Write good atomic tests Use the Chrome Driver Use Headless browser drivers Re-use the browser instance Run scripts in parallel Use HTTP-parse libraries like JSoup Pre-populate cookies Do not load images Read the entire article here: Source:  http://www.beacon.by/test-automation-for-manual-testers/10-tips-for-faster-selenium-scripts#/4

IntelliJ - Convert the Java project into a Maven project/module

Image
IntelliJ - Convert the  Java project into a Maven project/module: Right-click on the module, select "Add framework support...", and check the "Maven" technology. (This also creates a pom.xml for you to modify.) Maven repositories you need: http://mvnrepository.com/ Maven Information If you're using Maven, you will find all Selenium Maven artifacts directly in the central Maven repository here:  http://repo1.maven.org/maven2/org/seleniumhq/selenium/ In order to start using  DefaultSelenium  or one of the new  WebDriver  implementations in your Maven project, just add the following dependency to your  pom.xml : org.seleniumhq.selenium selenium-java 2.48.2 Note : 2.48.2 : The version at the time the post was written Source: http://www.seleniumhq.org/download/maven.jsp

Reporting API - Selenium / Test Automation framework

Image
I have been wanting to use this reporting API ever since I heard of it, finally I got my hands dirty with the version 2.0 and I must say it's pretty impressive - If you use either Java or .Net for testing then this is what you need - Extent Reports This is how a sample html report looks like HTML report I shall not go about rewording how to use it, their documentation is pretty good:  http://relevantcodes.com/Tools/ExtentReports2/ExtentJava.html Quick snapshot: Using Maven to download the dependencies Using JUnit for logging and reporting Using TestNG for logging and reporting If you don't want the logging the easiest way without changing anything is using the TestNG Listener -  http://relevantcodes.com/testng-listener-using-extentreports/ Source: http://relevantcodes.com/extentreports-for-selenium/ Happy Test Reporting :P

Intellij Musing - Test Automation framework with Selenium Cucumber TestNG Maven Jenkins and GIT

Image
Pull the project from the scm repository in my case Git In IntelliJ File -> New -> Project from existing sources and navigate to the root directory Choose Import from external mode - Maven/Eclipse as need be  Update the pom.xml Maven clean run / Generate source and Update Folders Options to run: Right click and run the individual feature file Right click and run the TestNG.xml file - To run tests in parallel Right click and run the individual cucumber runner file - To run tagged tests Reports: Cucumber pretty format - Index.html Cucumber JSON report Customized html report

Microsoft Edge supports Selenium WebDriver

Image
Good news for the test automation folks! In another developer-friendly move, Microsoft announces that its new Edge browser supports the WebDriver automated testing technology. Microsoft may be distancing its new Edge browser from Internet Explorer (IE) and its contentious past, but it is inheriting at least some developer features. In addition to an   improved set of F12 tools , the company announced that Edge supports WebDriver, an emerging automated site-testing standard from the World Wide Web Consortium (W3C). Windows Insiders, members of Microsoft's beta program, can test the functionality in build 10240 or newer. The company first   added WebDriver support to IE 11   a year ago. The use of WebDriver with Edge requires running Microsoft WebDriver server software with Microsoft Edge on Windows 10 (build 10240 and above). Microsoft halted downloads of the server after a "publishing issue" cropped up, but the company hopes to restore the software later toda...

POM file Maven Dependency Injection - CheatSheet

Image
When you depend on a plugin or a dependency, you can use the a version value of LATEST or RELEASE . LATEST refers to the latest released or snapshot version of a particular artifact, the most recently deployed artifact in a particular repository.  RELEASE refers to the last non-snapshot release in the repository. A square bracket ( [ & ] ) means "closed" (inclusive).  A parenthesis ( ( & ) ) means "open" (exclusive). Best Practice: In general, it is not a best practice to design software which depends on a non-specific version of an artifact. If you are developing software, you might want to use RELEASE or LATEST as a convenience so that you don't have to update version numbers when a new release of a third-party library is released. When you release software, you should always make sure that your project depends on specific versions to reduce the chances of your build or your project being affected by a software release not under your cont...

TestNg v/s JUnit Annotations

Image

LeanFT = QTP/UFT + Continuous Integration + Agile + Opensource in the HP world

Image
Can you believe that HP has come up with this new tool/plugins that they call LeanFT, obviously the name suggests that it's the lean way of doing functional testing. Let's see what they claim: Key Highlights and what's good: Automation in Java or C# - definitely something that most automation folks were looking forward to Compatible with UFT's object Identification engine- hmm :) Continuous Integration - Has integration with Jenkins  Supports BDD tools like Cucumber/Jbehave Integration with SCM tools like Git/SVN IDE would be your standard Eclipse / TFS Same reporting as before but with all of the above Unit testing frameworks like JUnit/ Nunit Integration with other HP tools -  HP Application Lifecycle Management, HP Quality Center, and HP Mobile Center. Interesting fun facts: QTP's Object spy from Visual studio/Eclipse Free license if you already have the UFT 12.5 license customized html reports Release Date: July 2015 along with  UFT ...