August 17, 2017

Please reload

Recent Posts

Discover How to Automate Mobile App Testing Without Scripting at MWC16

The first two days of Mobile World Congress in Barcelona have been exciting, as...


January 23, 2017

Please reload

Featured Posts

Integrate with HPE ALM Quality Center

October 5, 2017

Jamo Automator test cases can be easily integrated with HP Quality center.


When adding a test to your Test Plan fill in the required fields and make sure to select the VAPI-XP-TEST type as shown in the screenshot below



Click OK and select VBScript as your script language.



Click finish and open the Test Script tab. In this tab replace all of the generated script with the code snippet found here:


Make sure to replace the parameters defined on top (in the green section) with your credentials, test case and device

                 ' vbtest [VBScript]
' Created by Application Lifecycle Management
' 13/09/2017 12:04:11
' ====================================================

' ----------------------------------------------------
' Main Test Function
' Debug - Boolean. Equals to false if running in [Test Mode] : reporting to Application Lifecycle Management
' CurrentTestSet - [OTA COM Library].TestSet.
' CurrentTSTest - [OTA COM Library].TSTest.
' CurrentRun - [OTA COM Library].Run.
' ----------------------------------------------------
Sub Test_Main(Debug, CurrentTestSet, CurrentTSTest, CurrentRun)
  On Error Resume Next
  ' clear output window
  account="{your account}"
  user="{your username}"
  myPassword="{your password}"
  testCaseName="{your test case name}"
  deviceName="{your device name}"

 'if the device name is not unique please use udid instead

  deviceUDID="{your udid}"

  timeoutInSeconds={how many seconds you should try}

  'GET the access token
  Set loginRestReq = CreateObject("Microsoft.XMLHTTP")
  loginUrl = jamoServerUrl+"/rest/login?account="+account+"&j_username="+ user +"&j_password="+myPassword "POST", loginUrl, false
  If loginRestReq.status <> 200 Then
      TDOutput.Print "Could not connect to server: please verify if Jamo is up and running"
      set myStep = CurrentRun.StepFactory.addItem("Connect to Jamo")
      myStep.Field("ST_DESCRIPTION") = "Could not connect to server: please verify if Jamo Automator is up and running"
      myStep.Status = "FAILED"
      CurrentRun.Status = "Failed"
      CurrentTSTest.Status = "Failed"
      set myStep = CurrentRun.StepFactory.addItem("Connect to Jamo")
      myStep.Status = "PASSED"
      If NOT successfulLogin Then
         TDOutput.Print "Could not login: please verify your credentials"
         set myStep = CurrentRun.StepFactory.addItem("Login to Jamo")
         myStep.Field("ST_DESCRIPTION") = "Could not login: please verify your credentials"
         myStep.Status = "FAILED"
         CurrentRun.Status = "Failed"
         CurrentTSTest.Status = "Failed"
         set myStep = CurrentRun.StepFactory.addItem("Login to Jamo")
         myStep.Status = "PASSED"
         'GET accessToken and user key
         accessToken = loginRestReq.GetResponseHeader("X-AUTH-TOKEN")
         'RUN the test case on device
         Set runReq = CreateObject("Microsoft.XMLHTTP")
         If IsEmpty(deviceUDID) Then
            runUrl = jamoServerUrl+"/rest/integration/run?testCase="+testCaseName+"&index=0&device="+deviceName+"&userKey="+userKey
            runUrl = jamoServerUrl+"/rest/integration/run/udid?testCase="+testCaseName+"&index=0&uniqueDeviceIdentification="+deviceUDID+"&userKey="+userKey
         End If "GET", runUrl, false
         runReq.setRequestHeader "X-AUTH-TOKEN", accessToken
         If NOT successfulRun Then
             TDOutput.Print runMessage
             set myStep = CurrentRun.StepFactory.addItem("Start to Run test case")
             myStep.Field("ST_DESCRIPTION") = runMessage
             myStep.Status = "FAILED"
             CurrentRun.Status = "Failed"
             CurrentTSTest.Status = "Failed"
             set myStep = CurrentRun.StepFactory.addItem("Start to Run test case")
             myStep.Status = "PASSED"
             While (waitForReport AND DateDiff("s",startTime,Now())<timeoutInSeconds)
                   XTools.Sleep 5000
                   Set reportReq = CreateObject("Microsoft.XMLHTTP")
                   reportUrl = jamoServerUrl+"/rest/integration/report/"+runMessage
          "GET", reportUrl, false
                   reportReq.setRequestHeader "X-AUTH-TOKEN", accessToken
                   If Len(reportReq.responseText) = 0 Then
                      TDOutput.Print "No report yet"
                      TDOutput.Print reportStatus
                           'We need to wait for a while until the result steps are all there
                           XTools.Sleep 50000
                           'Get the result steps
                           TDOutput.Print reportKey
                           Set resultsReq = CreateObject("Microsoft.XMLHTTP")
                           resultsUrl = jamoServerUrl+"/rest/integration/resultSteps/"+reportKey
                  "GET", resultsUrl, false
                           resultsReq.setRequestHeader "X-AUTH-TOKEN", accessToken
                           TDOutput.Print resultsReq.responseText
                           For i = 0 to UBound(resultSteps)
                                         set myStep = CurrentRun.StepFactory.addItem("Null")
                                         myStep.Field("ST_DESCRIPTION") = Split(resultSteps(i),";")(2)
                                         myStep.Status = Split(resultSteps(i),";")(0)
                      If reportStatus = 2 Then
                          CurrentRun.Status = "Failed"
                          CurrentTSTest.Status = "Failed"
                      End If
                   End If
             If waitForReport Then
                   TDOutput.Print "Could not find report within time out"
                   CurrentRun.Status = "Failed"
                   CurrentTSTest.Status = "Failed"
             End If
         End If
      End If
  End If
End Sub

That's it: you can now run your test case


Share on Facebook
Share on Twitter
Please reload

Please reload

Search By Tags
Please reload



Jamo Solutions provides state-of-the art solutions for UI-based test automation on mobile devices. 'Jamo Automator' is a codeless cloud-based  tool that lets you focus on the test case without the hassle of scripting.


Houtemstraat 157, 3300 Tienen, Belgium

© 2018 by Jamo Solutions