Highlighted
Member.
208 views

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,

 

 

Labels (1)
0 Likes
1 Reply
Highlighted
Micro Focus Expert
Micro Focus Expert

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

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.