BrowserStack and RobotFramework Integration


In this post, we will integrate RobotFramework with BrowserStack and we will run our test in BrowserStack’s cloud grid system. Last week, I desribed how to install and use RobotFramework in this post. If you don’t have any experience or if you don’t know how to use RobotFramework, please check that post first.

Please, see the latest update for RobotFramework and Selenium 3.0 Integration in this article

I want to go with the same Linkedin Login test example. Our test scenario is shown below:

  • Open LinkedinPage
  • Check Title
  • Enter User Name
  • Enter Wrong Password
  • Click Login
  • Wait 5 seconds
  • Assert Warning Message
  • Close Browser

This time, I want to use two files for better test structure. These are setup.robot and BrowserStackLoginTest.robot

We will have two folders one of them is Resource and the other is Tests folder. Resource folder comprises of setup.robot and Tests folder contains BrowserStackLoginTest.robot file.

robot_browserstack3

setup.robot file holds Settings, Variables, Keywords information and BrowserStackLoginTest.robot contains test codes.

setup.robot

In order to connect BrowserStack we should register it and have an account. By using our account’s AccessKey and username information, we can connect BrowserStack. Also, we should use desired capabilities to declare which operating system, browser, browser version, OS version , etc. we will use. In below code, I did all these settings.

When I tried to run same test on BrowserStack I got an encoding error on “Title Should Be” method. I tried to fix that encoding problem but I was not successful. I also asked this issue on stackoverflow (Link: http://stackoverflow.com/questions/36936352/how-to-match-browserstack-and-robotframework-encoding). If you know the solution, please write a comment.

Error Screen is shown below. 🙁

TitleShouldBe_EncodingError

Now, lets write our test robot file.

BrowserStackLoginTest.robot

Execution & Results

Open command prompt and go to your test folder and then type below command.

Then, you will see below execution on command prompt.

browserstack

and you will see test execution on BrowserStack’s Dashboard.

robotframework

browserstack_ressults

[/fusion_builder_column][/fusion_builder_row][/fusion_builder_container]
javafx

Database Operations in JavaFX

By Onur Baskirt / Apr 1, 2016 / 56 Comments
Before started this section, please check the first article and learn How to Start JAVAFX! http://www.swtestacademy.com/getting-started-with-javafx/ At first, part of JavaFX tutorial series, we created a sample JavaFX project, designed the draft version of the UI and set up an...
rest assured

REST API Testing with Rest Assured

By Onur Baskirt / Mar 8, 2016 / 32 Comments
Outline In this post, I will explain what is API and API testing, what is the difference between SOAP and REST services, and how to test REST APIs with Rest Assured Library. What is API? API stands for Application Programming...
extentreports

How to Write Effective CSS Locators

By Onur Baskirt / Oct 1, 2017 / 0 Comments
Hi all, in this tutorial, I will describe you how to write effective CSS locators to interrogate web elements for your automation projects. As a rule of thumb, your interrogation strategy should be in below order: First try to use...
extentreports

Selenium-11: Execute JavaScript with JavascriptExecutor

By Onur Baskirt / Jan 27, 2016 / 15 Comments
Outline Sometimes we cannot handle some conditions or problems with Webdriver, web controls don't react well against selenium commands. In this kind of situations, we use Javascript. It is useful for custom synchronizations, hide or show the web elements, change...
javafx

Getting Started with JavaFX

By Onur Baskirt / Mar 25, 2016 / 0 Comments
When I started to work in my current position, one of my task is to do manual operations for campaign products  every week. After the second week, I thought that I have to automate this task using a GUI based...
extentreports

How to Write Smart XPath Locators

By Onur Baskirt / Sep 24, 2017 / 4 Comments
Hi all, in this tutorial, I will describe you how to write smart and non-brittle XPath locators. When we write our test scripts, we generally prefer to use id, name, class, etc. these kinds of locators. However, sometimes we could not...
extentreports

Selenium-1: Quick Start to Automation with Selenium WebDriver & JAVA & JUnit & Maven & IntelliJ

By Onur Baskirt / Sep 8, 2015 / 26 Comments
Outline Selenium Webdriver is the most popular open source web test automation framework across wide range of browsers and platforms. In this tutorial you will learn how to do web test automation with Selenium Webdriver and the related tools. Audience...
page object model

Page Object Model with C#

By Ege Aksoz / Jun 18, 2017 / 8 Comments
In the previous tutorial, we’ve taken the initial steps and entered the world of automated testing. We also wrote our first automated test. From this point on, since we are not just going to write one test, we need to...
extentreports

How to Select a Date From DatePicker Using Selenium

By Onur Baskirt / Aug 13, 2016 / 6 Comments
When you need to automate a airway, hotel, or similar websites you need to deal with Datepickers and some times it is a little bit cumbersome to select a specific date on the Datepicker or calendar.  In this post, I...
extentreports

Selenium Webdriver Performance testing with Jmeter and Selenium Grid

By Ozgur Kaya / Aug 9, 2016 / 2 Comments
In this post, we will complete Selenium Webdriver Performance testing scenario using Jmeter and Selenium Grid. 1- Install Java 7 or later If necessary https://java.com/tr/download/ 2- Download latest Jmeter version 3.0 or higher. http://jmeter.apache.org/download_jmeter.cgi 3- Download Jmeter PluginsManager JAR file and...
By | 2017-05-11T01:26:23+00:00 April 29th, 2016|RobotFramework, Test Automation, Web Automation|9 Comments

About the Author:

Onur Baskirt
Onur Baskirt is a senior IT professional with 10+ years of experience. He worked at Bahçesehir University, ST Microelectronics, Huawei and Ericsson as research assistant, design verification engineer and software test leader. Also, he worked as software test leader and software operations manager at Turkey's biggest technology retailer, Teknosa. Now, he is working as Head of Software Testing and Manager of two Development Teams at Kariyer.net. His current research areas are technical software testing, programming, and computer science. Formerly, he has several research works and papers on digital chip design & verification. His hobbies are sport, dancing, traveling, and nutrition. You can find detailed information about him on his linked-in page.

9 Comments

  1. Bharat Joshi June 22, 2016 at 3:08 pm - Reply

    I have tried the same code and it is giving an error as no browser is open on the keyword openLinkedinpage

  2. Bharat Joshi June 22, 2016 at 3:10 pm - Reply

    Also the response code 10061 from Selenium2Library

    • Onur Baskirt
      Onur Baskirt June 23, 2016 at 12:05 am - Reply

      Everything is working fine. I have just run the code again. I think you are doing something wrong.

  3. Jani October 20, 2016 at 5:47 pm - Reply

    Hey. How do you get the http://user@domain.com:pass@address working? For me it cuts already the address from the first @ -mark and tries to remote connect to pass@address as the remote url. I have tried escaping it with \ or putting %40 in place of @ for the email username. It does no have affect if I have the username and password in variables or write it straight to the the address.

    • Onur Baskirt
      Onur Baskirt October 21, 2016 at 12:24 am - Reply

      I really don’t know your question’s answer. Did you do a google search for that?

  4. mrudula January 25, 2017 at 9:50 pm - Reply

    How can pass the Testcase name to the bowsertack from RobotFramework? longside browser=${BROWSER} remote_url=${RemoteURL}

    • Onur Baskirt
      Onur Baskirt May 11, 2017 at 1:23 am - Reply

      You need to pass another parameter ${name} along with the desired capabilities.

  5. Salah August 7, 2017 at 6:25 pm - Reply

    It works fine for the public server, I need ti run the same think for a local server in the remote browser. I have this issue : Could not get IP address for host: hub.browserstack.com

    Please Help !

  6. KT August 28, 2017 at 9:27 am - Reply

    Has Any1 been able to implement the same in Jenkins pipeline for browserstack local testing

Leave A Comment