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]