Testing with BrowserStack

Overview

Testing with BrowserStack is a comfortable solution for remote testing which does not require the resources of your computer. With BrowserStack you can test both native apps and mobile browsers on Android and iOS mobile/tablet devices.

Register your account here.

Account credentials

After you register an account, you can choose one of the testing types:

On the top of one of these pages, you can find an element called ACCESS KEY. Here you’ll find your “User name” and “Access key”, which you’ll need to connect to the BrowserStack server. In the next step, we’ll establish a connection between your computer and the BrowserStack server to start your tests.

Local Binary

Now you need to download a binary to set a connection between your computer and the BrowserStack server. Download the Local Binary for your OS.

After the download is finished, unzip the binary. There are two options for how to run the local binary.

The first option is 1) open your command-line interface on the laptop and navigate to the folder containing the Local binary; 2) run the binary using the following command (you can find your access key here):

  • OS X / Linux: ./BrowserStackLocal --key <your access key>
  • Windows: BrowserStackLocal.exe --key <your access key>

Result:

The second option is 1) open a terminal in the Testlum; 2) run the binary using the following command (you can find your access key here):

  • /Users/user/Downloads/BrowserStackLocal --key <your access key>

Result:

Note: Whenever you want to run your tests with BrowserStack, you must run this Local Binary. Just run it once for the whole testing session, and after you finish testing, press Ctrl+C to close it.

<browserStackLogin>

Now you need to set your credentials in a config file. Create <browserStackLogin> block and fill <username> and <accessKey> with your account credentials from the App Automate or Automate pages.

XML
Copy

<native>

Create the <native> block inside your configuration file and follow these steps:

  1. create <connection> block and inside it create the <browserStack/>;
  2. inside <device> block create the <browserStackCapabilities> and fill them:
    1. <deviceName> - copy-paste the name of the needed device from the BrowserStack Support table.
    2. <platformVersion> - version of your device’s OS. Can also be found in the BrowserStack Support table;
    3. <app> - on the App Automate page, at the top, next to the "access key" you can find an element UPLOAD APP. Upload your application file (.apk or .app for Android and .ipa for iOS) and in response, you’ll get an "app url" like this: bs://b38b950cb32343bf34031234fcb5cd06fee0d831. Insert it inside <app>;

The final setup must look like this:

XML
Copy

<googlePlayLogin>

You can use an additional tag <googlePlayLogin> inside <browserStackCapabilities> to automatically log into your app. Fill it with your Google account credentials <email> and <password>.

XML
Copy

Note: Make sure you disabled additional security checks (like two-step verification) in your Google account that you want to use for logging in.

<mobilebrowser> setup

Create a <mobilebrowser> inside your configuration file and follow this steps:

  1. fill the <baseUrl> with the website URL which you want to test;
  2. create <connection> block with <browserStack/> inside it;
  3. inside <device> block create the <browserStackCapabilities> and fill them:
    1. <deviceName> - copy-paste the name of the needed device from the BrowserStack Support table.
    2. <platformVersion> - version of your device’s OS. Can also be found in the BrowserStack Support table;
XML
Copy

Running your tests

After you start your tests you can see the test execution in real time, interact with the device during test execution, and view your test results. Depending on which type of testing you have chosen, go to the App Automate or Automate page. Here you’ll see your tests dashboard where you can find tests in execution and finished ones in the All Builds section on the left. After the test is finished, you can view the results. BrowserStack provides test records, all kinds of logs, and other useful information.

Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard