How to Setup Bq Genie for Mobile Testing

Prerequisites

  • JDK
  • XCODE
  • Android
  • Appium
  • HomeBrew
  • Node
  • libimobiledevice

JDK Installation #

1. Go to JDK Download link.

2. Select  ‘Accept License Agreement’ and Click Download link corresponding to Mac OS X

3. Once file gets downloaded, double click on the file. ‘Java Development Kit’ pop up window will appear. Double click on the icon.

4. Follow the installation guide.

5. After finishing installation close install window and open the terminal and type java -version

Xcode Installation #

Xcode is an integrated development environment (IDE) containing a suite of software development tools developed by Apple for developing software for OS X and iOS

1. Open App Store. Search for XCODE. Look for an App as shown in the snapshot below. Click on GET.

Alternatively, you can also download it from here. Once you open an URL, click on ‘View in Mac App Store’

2. Sign In with Apple ID

3. Once download is complete, go to Launchpad. Click on XCODE icon

4. Click on Agree.

5. Once Installation is complete, navigate to Open Developer Tool>>Simulator.

6. Simulator will Open

Install ANDROID Studio #

1. Go to Android Developers tools website.

2. Download Android studio for Mac and follow the instruction to finish installation

3. Finish installation

4. Once complete installation start studio with new android studio project 

Creating Android virtual studio (AVD) #

1. After open android studio go to Tool>Android>AVD Manager, showing in the below screenshot

2. Click on Create Virtual Device… 

3. Select require Phone or Tablet and click next to setup virtual device

4. Download Android version and click on next

5. Accept license agreement to start download android OS.

6. Start downloading. wait some time to finish downloading

7. Once download completed, select downloaded os version and click next. Then finish the setup

8. Now double click on created Virtual device to launch

9. Finally launching the virtual device

Setting up ANDROID_HOME on MAC OS X #

  1. Open a terminal window.

  2. Then write command – open ~/.bash_profile

  3. Add ANDROID_HOME variable and update PATH variable. To change editor into Insert mode

           export ANDROID_HOME = /path to android folder

           export PATH=$ANDROID_HOME/platform-tools:$PATH

           export PATH=$ANDROID_HOME/tools:$PATH

Install Appium and required application for install Appium #

Open a terminal window.

  • Homebrew  – The easiest and most flexible way to install the UNIX tools that Apple didn’t include with macOS.  To install it, run the below command from a terminal:
    ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Mobile device libraries  – library and utility to talk to iBoot/iBSS via USB on Mac OS X. Run the below command:
    brew install libimobiledevice --HEAD
  • Node js  – Node.js is used to create fast web servers that can run JavaScript code on your computer free of any web browser. Appium use it internally.
    brew install node
  • Ios-deploy Node.js library  – used to install and debug iOS apps without using Xcode. Designed to work on un-jailbroken devices.
    npm install -g ios-deploy
  • Appium Node.js library  – this will be the framework for our tests
    npm install -g appium
  • Carthage  – Use to build webDriverAgent application using XCODE
    brew install Carthage

    IOS Webkit Debug Proxy – Use to send commands to MobileSafari and UIWebViews on real and simulated iOS devices.

brew install iOS-webkit-debug-proxy

After successfully installed all the application required, make sure Bq client installed with mobile enable during installation other wise will go to client setup and click on edit button and enable Mobile Available after that set Appium Home and Android Home.

Example :
Appium Home = /root-path-to-appium/node_modules/appium
Android Home = /path/to/sdk

After that need to sign in Webdriver Agent to allow application install in iPhone Device/Simulator. For sign in WebDriver Agent go through the following steps
1. Open xcode application. Open WebDriverAgent Project in xcode from appium installed path i.e "/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent".

2. Select project and then go to General Tab and check Automatically manage signing. and then select Team.

3. If Team not created previously then follow steps
a. Go to xcode and click on Preferences
b. Click on Accounts
c. Click on + sign to add new
d. Add Apple ID
e. Authentication popup will open set Apple id and password to create new.

4. For both the WebDriverAgentLib and WebDriverAgentRunner targets, select "Automatically manage signing" in the "General" tab, and then select your Development Team. This should also auto select Signing Certificate. The outcome should look as shown below.

5. Xcode may fail to create a provisioning profile for the WebDriverAgentRunner target.

6. This necessitates manually changing the bundle id for the target by going into the "Build Settings" tab, and changing the "Product Bundle Identifier" from com.facebook.WebDriverAgentRunner to something that Xcode will accept.

7. Going back to the "General" tab for the WebDriverAgentRunner target, you should now see that it has created a provisioning profile and all is well.

You can go to Settings => General => Device Management on the device to trust the developer and allow the WebDriverAgentRunner app to be run. Finally if all ok then go to Bqurious Server and run Recoding and execution using BqClient.