This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How is Mobile center invoked by using descriptive programming

Hi 

I don't want to open my MC from record and run settings, instead I want to open the MC and install the apps then execute the script. I have given below script where my MC gets opened, but instead it is showing a blank page. 

Is there any workaround to open MC and install apps from descriptive programming?

Environment.LoadFromFile("C:\Users\DASHConfig.xml")

'Assigning to variables
DeviceType = Environment.Value("DeviceType")
DeviceOS = Environment.Value("DeviceOS")
DeviceID = Environment.Value("DeviceID")
Username=Environment.Value("LoginId")
LoginPwd=Environment.Value("LoginPwd")


'MobileUtil.CallRestAPI 
'Create an instance of the QTP 
Set App = CreateObject("QuickTest.Application")
'App.Options.MCConnection.Type("0")
App.Options.MCConnection.Server = "/ServerName"
App.Options.MCConnection.Port = "Port"
App.Options.MCConnection.Username = "Username"
App.Options.MCConnection.Password = Pwd
App.Options.MCConnection.UseSSL = False
App.Options.MCConnection.ShowRemoteWndOnRun = False
'App.Options.MCConnection.SharedSpace = "123"
App.Options.MCConnection.WorkSpace = "Default Workspace"

'Create object for MobileLauncher
Set qtMobileLauncher=App.Test.Settings.Launchers.Item("Mobile")

'Defining device to use in Test script
qtMobileLauncher.Lab = "mc"
qtMobileLauncher.LaunchOnStart

 

Thanks,

 

 

  • 0  

    Hi Pavin_15,

    When you run a Mobile test and it gets to a line where it interacts with a mobile test object, UFT will first determine the device and app that it will be used for the run session based on the Device and App test objects' description (no matter if it is given using Object Repository or Descriptive Programming). If these details are not provided in the test objects’ descriptions, then UFT uses the device and application that were defined in UFT’s Record and Run Settings.

    For example, using Descriptive Programming, in the below line I am specifying the device and app that will be used, so the settings under UFT’s Record and Run Settings will be skipped:

    Device("id:=0815f86254b00404").App("identifier:=com.Advantage.aShopping","instrumented:=true").Launch Install

    For more info, check “UFT Mobile test run flow” topic through the below link:
    https://admhelp.microfocus.com/uft/en/15.0/UFT_Help/Content/MC/mobile_on_UFT_run.htm#mt-item-0

    Regards,
    Alvaro