Note
This API has been available since API level 24.
This API has been available since API level 24.
Intended for interacting with web applications
Overall algorithm of using the tellurium is the following:
API level 24
Sends message to all TelluriomNub instances
Name | Required | Type | Description |
---|---|---|---|
command | Optional | String | Command to broadcast. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Always returns true. |
Example : Command parameter specified
# luna-send -n 1 -f luna://com.palm.service.tellurium/broadcastCommand '{"command": "test"}'
Response:
{
"returnValue": true
}
Example : Empty command parameter
# luna-send -n 1 -f luna://com.palm.service.tellurium/broadcastCommand '{"command": ""}'
Response:
{
"returnValue": true
}
Example : No command parameter
# luna-send -n 1 -f luna://com.palm.service.tellurium/broadcastCommand '{}'
Response:
{
"returnValue": true
}
API level 24
handleRequest allows to process requested method
Available methods are:
Name | Required | Type | Description |
---|---|---|---|
command | Required | String | JSON describing the command to be executed and its parameters. Specify one of the following methods:
|
stageId | Required | Number | Stage ID. Note:
|
queue | Optional | Object array: queue | Contains the command to execute to get the element information [optionally an additional parameter "filter" is used to extract the required content from object hierarchy]. For more details refer 'queue object' under Objects section. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates whether the execution succeeded.
|
result | Optional | Object: getRunningAppsAndStagesResult | Result obtained when "command" parameter is "getRunningAppsAndStages". Note: Either one of the "result" parameters is returned based on the command parameter. |
result | Optional | Object: getApplicationInformationResult | Result obtained when "command" parameter is "getApplicationInformation". Note: Either one of the "result" parameters is returned based on the command parameter. |
result | Required | Object: getItemsResult | Result obtained when "command" parameter is "getItems". Note: Either one of the "result" parameters is returned based on the command parameter. |
errorCode | Optional | Number | Identifies the error. The method will return errorCode only if it fails. See the Error Codes Reference for more details. |
errorText | Optional | String | Describes the error. The method will return errorText only if it fails. See the Error Codes Reference for more details. |
teCommandId | Optional | Number | An integer assigned by telluriumD service when the given command is not in mapped list and its redirected to stage. |
Example : Command is getRunningAppsAndStages
# luna-send -n 1 -f luna://com.palm.service.tellurium/handleRequest '{"command": "getRunningAppsAndStages"}'
Response:
{
"result":[
{
"appId":"MaliitServer",
"stages":[
{
"width":0,
"id":1002,
"isActive":false,
"scene":"",
"height":0,
"type":"",
"name":""
}
]
},
{
"appId":"com.webos.app.inputcommon",
"stages":[
{
"width":0,
"id":1001,
"isActive":false,
"scene":"",
"height":0,
"type":"",
"name":""
}
]
},
{
"appId":"surface-manager-starfish",
"stages":[
{
"width":0,
"id":1000,
"isActive":false,
"scene":"",
"height":0,
"type":"",
"name":""
}
]
}
],
"returnValue":true
}
Example : Command is getApplicationInformation
# luna-send -n 1 -f luna://com.palm.service.tellurium/handleRequest '{"command": "getApplicationInformation", "stageId": 1000}'
Response:
{
"result": {
"resolution": {
"width": 1920,
"height": 1080
},
"displayId": -1,
"pid": 1940,
"isQmlApplication": true,
"id": "surface-manager"
},
"returnValue": true,
"teCommandId": 5
}
Example : Command is getItems
# luna-send -n 1 -f luna://com.palm.service.tellurium/handleRequest '{"command": "getItems", "stageId": 1000}'
Response:
{
"result":[
{
"objectIdHierarchy":"10875168",
"classHierarchy":"QQuickRootItem",
"class_name":"QQuickRootItem",
"mapped_lefttop_x":0,
"window":{
"id":"11266048",
"width":1920,
"isVisible":true,
"activeFocusItem":"26405216",
"y":0,
"x":0,
"isActive":true,
"title":"LunaSurfaceManager - Goldfinger Edition",
"view":{
"source":"file:///usr/lib/qml/WebOSCompositorBase/main.qml"
},
"contentItem":"10875168",
"height":1080
},
"object_name":"",
"height":1080,
"metaProperties":{
"x":0,
"implicitWidth":0,
"containmentMask":"QObject* == 0",
"rotation":0,
"y":0,
"layer":"QQuickItemLayer* 20470560: # (QQuickItemLayer)",
"top":"QQuickAnchorLine",
"transitions":"QQmlListProperty<QQuickTransition>",
"horizontalCenter":"QQuickAnchorLine",
"implicitHeight":0,
"verticalCenter":"QQuickAnchorLine",
"z":0,
"objectName":"",
"visible":true,
"childrenRect":"0,0:1920x1080",
"transformOrigin":4,
"clip":false,
"opacity":1,
"data":"QQmlListProperty<QObject>",
"enabled":true,
"resources":"QQmlListProperty<QObject>",
"scale":1,
"anchors":"QQuickAnchors* 20407624: # (QQuickAnchors)",
"states":"QQmlListProperty<QQuickState>",
"parent":"QQuickItem* == 0",
"baseline":"QQuickAnchorLine",
"activeFocusOnTab":false,
"visibleChildren":"QQmlListProperty<QQuickItem>",
"left":"QQuickAnchorLine",
"state":"",
"transformOriginPoint":"960,540",
"right":"QQuickAnchorLine",
"baselineOffset":0,
"focus":true,
"height":1080,
"activeFocus":true,
"smooth":true,
"transform":"QQmlListProperty<QQuickTransform>",
"children":"QQmlListProperty<QQuickItem>",
"bottom":"QQuickAnchorLine",
"width":1920,
"antialiasing":false
},
"id":"10875168",
"devicePixelRatio":1,
"global_x":0,
"width":1920,
"mapped_lefttop_y":0,
"hierarchy":"#",
"isVisible":true,
"global_y":0
},
{
"object_name":"",
"id":"12736984",
"hierarchy":"# #",
"width":1920,
"isVisible":true,
"mapped_lefttop_x":0,
"mapped_lefttop_y":0,
"height":1080,
"global_y":0,
"metaProperties":{
"x":0,
"implicitWidth":0,
"containmentMask":"QObject* == 0",
"rotation":0,
"y":0,
"layer":"QQuickItemLayer* 24596464: # (QQuickItemLayer)",
"top":"QQuickAnchorLine",
"transitions":"QQmlListProperty<QQuickTransition>",
"horizontalCenter":"QQuickAnchorLine",
"implicitHeight":0,
"verticalCenter":"QQuickAnchorLine",
"z":0,
"objectName":"",
"visible":true,
"childrenRect":"0,0:1920x1080",
"transformOrigin":4,
"clip":false,
"opacity":1,
"data":"QQmlListProperty<QObject>",
"enabled":true,
"resources":"QQmlListProperty<QObject>",
"scale":1,
"anchors":"QQuickAnchors* 12888808: # (QQuickAnchors)",
"states":"QQmlListProperty<QQuickState>",
"parent":"QQuickItem* 10875168: # (QQuickRootItem)",
"baseline":"QQuickAnchorLine",
"activeFocusOnTab":false,
"visibleChildren":"QQmlListProperty<QQuickItem>",
"left":"QQuickAnchorLine",
"state":"",
"transformOriginPoint":"960,540",
"right":"QQuickAnchorLine",
"baselineOffset":0,
"focus":true,
"height":1080,
"activeFocus":true,
"smooth":true,
"transform":"QQmlListProperty<QQuickTransform>",
"children":"QQmlListProperty<QQuickItem>",
"bottom":"QQuickAnchorLine",
"width":1920,
"antialiasing":false
},
"objectIdHierarchy":"10875168 12736984",
"global_x":0,
"class_name":"QQuickFocusScope",
"devicePixelRatio":1,
"classHierarchy":"QQuickRootItem QQuickFocusScope"
}
],
"returnValue":true,
"teCommandId":9
}
API level 24
Called by a nub to notify that an event occured
Name | Required | Type | Description |
---|---|---|---|
stageId | Required | Number | Stage ID. Note: An integer that is dynamically assigned to a loaded application by telluriumd service. |
type | Required | String | Event type. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates whether the execution succeeded.
|
errorCode | Optional | Number | Identifies the error. The method will return errorCode only if it fails. See the Error Codes Reference for more details. |
errorText | Optional | String | Describes the error. The method will return errorText only if it fails. See the Error Codes Reference for more details. |
Example scenario
# luna-send -n 1 -f luna://com.palm.service.tellurium/notifyEvent '{"stageId": 1000, "type": "stageActivate"}'
Response:
{
"returnValue": true
}
Example scenario
# luna-send -n 1 -f luna://com.palm.service.tellurium/notifyEvent '{ "stageId": 1000, "type": ""}'
Response:
{
"returnValue": true
}
API level 24
Allows to perform 'are-you-alive' check. Mirrors sent message
Name | Required | Type | Description |
---|---|---|---|
Message | Optional | String | Ping message |
Name | Required | Type | Description |
---|---|---|---|
[none] | Optional | String | Mirrored message. |
Example : Message parameter is specified
# luna-send -n 1 -f luna://com.palm.service.tellurium/ping '{ "Message": "test" }'
Response:
{
"Message": "test"
}
Example : Empty Message parameter
# luna-send -n 1 -f luna://com.palm.service.tellurium/ping '{ "Message": "" }'
Response:
{
"Message": ""
}
Example : No parameter
# luna-send -n 1 -f luna://com.palm.service.tellurium/ping '{}'
Response:
{
}
API level 24
This is called when a subscriber needs to reply to a command i.e., Sends a reply to the TelluriumdService from TelluriumNub(Webapp) or Qttestability(QML app) when client sends luna-send request to get element information for an application.
For more details on replyToCommand Valid case, Please refer Internal notes section.
Name | Required | Type | Description |
---|---|---|---|
stageId | Required | Number | Stage Id is an integer dynamically assigned to a loaded application by telluriumd service. |
teCommandId | Required | Number | Its an integer used as parameter to replyToCommand |
command | Required | String | Command that is used to execute the list of any testability commands. Ex:commandsBatch |
queue | Required | Object array: queue | Contains the command to execute to get the element information [optionally an additional parameter "filter" is used to extract the required content from object hierarchy]. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates whether the execution succeeded.
|
errorCode | Optional | Number | Identifies the error. The method will return errorCode only if it fails. See the Error Codes Reference for more details. |
errorText | Optional | String | Describes the error. The method will return errorText only if it fails. See the Error Codes Reference for more details. |
teCommandId | Optional | Number | Its an integer assigned by telluriumD service when the given command is not in mapped list and its redirected to stage. |
Example scenario
# luna-send -n 1 -f luna://com.palm.service.tellurium/handleRequest '{
"stageId": 1002,
"command": "commandsBatch",
"queue": [{"command": "getItems", "filter": {"objectName": "leftFunctionArea"}}]
}'
Response:
{
"teCommandId": 14,
"result": [
{
"result": [
{
"classHierarchy": "QQuickRootItem QQuickRectangle_QML_154 NormalKeyboard_QMLTYPE_149
...
}
],
"returnValue": true
}
Example response for a failed call (missing parameter 'command'):
# luna-send -n 1 -f luna://com.palm.service.tellurium/handleRequest
'{"stageId": 1000,
"queue": [{"command": "getItems",
"filter": {"objectName": "starfishOverlayView"}}]
}'
{
"errorCode": -1,
"returnValue": false,
"errorText": "Parameter 'command' is missing"
}
Example response for a failed call (Invalid value to command parameter:command="commandsBatch1"):
# luna-send -n 1 -f luna://com.palm.service.tellurium/handleRequest
'{"stageId": 1000,
"command": "commandsBatch1",
"queue": [{"command": "getItems",
"filter": {"objectName": "starfishOverlayView"}
}]
}'
{
"errorCode": 0,
"returnValue": false,
"errorText": "command 'commandsBatch1' is unknown",
"teCommandId": 61
}
Example response for a failed call (Invalid value to command parameter: command=1234):
luna-send -n 1 -f luna://com.palm.service.tellurium/handleRequest
'{"stageId": 1000,
"command": 1234,
"queue": [{"command": "getItems",
"filter": {"objectName": "starfishOverlayView"}
}]
}'
{
"errorCode": 0,
"returnValue": false,
"errorText": "command name is not specified",
"teCommandId": 63
}
Note: Same response occurs when command parameter assigns with true(boolean), "abcd"(string)
Example response for a failed call (missing parameter 'queue' object):
# luna-send -n 1 -f luna://com.palm.service.tellurium/handleRequest
'{"stageId": 1000,
"command": "commandsBatch"
}'
{
"result": null,
"returnValue": false,
"teCommandId": 65
}
Example response for a failed call (Invalid value to 'queue' object:queue="abcd"):
# luna-send -n 1 -f luna://com.palm.service.tellurium/handleRequest
'{"stageId": 1000,
"command": "commandsBatch",
"queue": "abcd"
}'
{
"result": null,
"returnValue": false,
"teCommandId": 66
}
Note: Same response occurs when invalid values true(boolean), 1234(number) assigned to queue object
Example response for a failed call (Invalid value to command of 'queue' object: command=1234):
# luna-send -n 1 -f luna://com.palm.service.tellurium/handleRequest
'{"stageId": 1000,
"command": "commandsBatch",
"queue": [{"command": 1234,
"filter": {"objectName": "starfishOverlayView"}
}
]
}'
{
"result": [
{
"errorCode": 0,
"returnValue": false,
"errorText": "command name is not specified"
}
],
"returnValue": true,
"teCommandId": 68
}
Note: Same response occurs when invalid values true(boolean), "abcd"(string) assigned to queue object
Example response for a failed call (None Parameter):
# luna-send -n 1 -f luna://com.palm.service.tellurium/replyToCommand '{}'
{
"errorCode": -1,
"returnValue": false,
"errorText": "Parameter 'teCommandId' is missing"
}
Example response for a failed call(Invalid Command ID):
# luna-send -n 1 -f luna://com.palm.service.tellurium/replyToCommand '{"teCommandId": "0"}'
{
"errorCode": -1,
"returnValue": false,
"errorText": "Command ID is invalid"
}
Example response for a failed call(Invalid Json Error):
# luna-send -n 1 -f luna://com.palm.service.tellurium/replyToCommand '{"teCommandId: "0"}'
{
"errorCode": 4,
"returnValue": false,
"errorText": "Invalid JSON message"
}
API level 24
Subscribes to Tellurium commands
Name | Required | Type | Description |
---|---|---|---|
subscribe | Required | Boolean | Indicates whether to subscribe for related events.
|
appInfo | Required | Object: appInfo | JSON containing application info. |
baseURI | Optional | String | Document URI |
width | Optional | Number | Window width |
height | Optional | Number | Window height |
name | Required | String | Window name |
scene | Required | String | Scene name |
version | Optional | String | Nub version |
type | Required | String | type name |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates whether the execution succeeded.
|
errorCode | Optional | Number | Identifies the error. The method will return errorCode only if it fails. See the Error Codes Reference for more details. |
errorText | Optional | String | Describes the error. The method will return errorText only if it fails. See the Error Codes Reference for more details. |
subscribed | Optional | Boolean | Indicates if the call was subscribed.
|
stageId | Optional | Number | An integer dynamically assigned to a loaded application by telluriumd service. |
Example scenario
# luna-send -i luna://com.palm.service.tellurium/subscribeToCommands '{
"subscribe":true,
"appInfo":{"id":"amazon.html"},
"baseURI":"file:///media/cryptofs/apps/usr/palm/applications/amazon.html/index.html",
"width":1280,
"height":720,
"name":"",
"type":"card",
"scene":"phone",
"version":"2.2.6"
}'
Response:
{
"subscribed":true,
"stageId":1006,
"returnValue":true
}
API level 24
Subscribes to stages' events (received from stage in notifyEvent)
Name | Required | Type | Description |
---|---|---|---|
subscribe | Required | Boolean | Indicates whether to subscribe for notifications. Possible values are:
|
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates whether the execution succeeded.
|
errorCode | Optional | Number | Identifies the error. The method will return errorCode only if it fails. See the Error Codes Reference for more details. |
errorText | Optional | String | Describes the error. The method will return errorText only if it fails. See the Error Codes Reference for more details. |
subscribed | Optional | Boolean | Indicates if the call was subscribed. |
Example scenario
# luna-send -i luna://com.palm.service.tellurium/subscribeToEvents '{"subscribe":true}'
Response:
{
"subscribed":true,
"returnValue":true
}
API level 24
Returns the tellurium version from the submission tag.
None
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates whether the execution succeeded.
Applicable to: None |
version | Optional | String | Version details. |
Example scenario
# luna-send -n 1 -f luna://com.palm.service.tellurium/version '{}'
Response:
{
"returnValue": true,
"version": "v2.0.0"
}
Provide the application ID to subscribe.
Ex: "appInfo":{"id":"amazon.html"}
Name | Required | Type | Description |
---|---|---|---|
id | Required | String | Application Id Ex:"amazon.html" |
resolution | Optional | Object: resolution | resolution containing width and height |
Its an object that describes details to apply the filter (usually used when "command": "getItems")
Name | Required | Type | Description |
---|---|---|---|
className | Optional | String | Filter objects by class name. Class name is compared by first characters. i.e. if className from filter "QQuickText", and item's class name is "QQuickText_QML_124",item matches filter. |
objectName | Optional | String | string, filter object by object name. |
visible | Optional | Boolean | Filter object by visibility |
onlyActiveWindow | Optional | Boolean | Fetch only objects from active/inactive window(s) |
hierarchy | Optional | String | Filter only objects matched to hierarchy, represented by object names. |
Provides QML application information.
Name | Required | Type | Description |
---|---|---|---|
resolution | Required | Object: resolution | Screen resolution |
displayId | Required | Number | Contains information about the displayID on which the application is running. By default the displayID value is -1 |
pid | Required | Number | Process Id of the running application |
isQmlApplication | Required | Boolean | Returns true if requested application is Qml app otherwise false |
id | Required | String | Name of the Requested Application |
Provides element information for QML application using object hierarchy.
Name | Required | Type | Description |
---|---|---|---|
objectIdHierarchy | Required | String | Generates string with hierarchy based on object id Ex:"objectIdHierarchy": "23278552" |
classHierarchy | Required | String | Generates string with hierarchy based on class names. Ex:"classHierarchy": "QQuickRootItem" |
class_name | Required | String | Get object instance class name as a string with Qt's meta-object system. |
mapped_lefttop_x | Required | Number | The x co-ordinate that is obtained by calling mapToScene() of QQuickItem Class, which Maps the given point in this item's coordinate system to the equivalent point within the scene's coordinate system, and returns the mapped coordinate. |
window | Optional | Object: window | Returns the window in which this item is rendered. |
object_name | Required | String | This property holds the name of the object. By default, this property contains an empty string. |
height | Required | Number | Returns window height of the item |
metaProperties | Required | Object | Provides the multiple properties like x,y co-ordinates, and so on for the requested QML application. |
id | Required | String | Provides window id as a string . Ex:"id": "23278552" |
devicePixelRatio | Required | Number | Returns the ratio between physical pixels and device-independent pixels for the window. |
global_x | Required | Number | Provides the global x co-ordinate of Quick Item Ex:"global_x": 0 |
width | Required | Number | Provides the width of the item. Ex: "width": 512 |
mapped_lefttop_y | Required | Number | The y co-ordinate that is obtained by calling mapToScene() of QQuickItem Class, which Maps the given point in this item's coordinate system to the equivalent point within the scene's coordinate system, and returns the mapped coordinate. |
hierarchy | Required | String | Provides the hierarchy in string format. Hierarchy of the item is found by prefixing the object name with # from the parent to current item. Ex: If parent item object name is "" and hierarchy is "#" and current item object name is "secondaryMain" then hierarchy of the current item is "# #secondaryMain" |
isVisible | Required | Boolean | Provides the details of the visibility of the item. Item is visible if set to true otherwise set to false. Ex: "isVisible": true |
global_y | Required | Number | Provides global y co-ordinates of Quick item. Ex:"global_y": 0 |
Provides running and staging information of QML apps.
Name | Required | Type | Description |
---|---|---|---|
appId | Required | String | Application Id of the running app |
displayId | Required | Number | displayId on which the application is running. By default the displayId value is 0. |
stages | Required | Object: stages | Contains process id, stage Id, name, isActive, scene, type information of the running application along with the display width and height. |
a)queue(mandatory): array, containing objects, each representing any of testability commands. b)queue(mandatory): array, containing objects, each representing filter and properties array. |
Name | Required | Type | Description |
---|---|---|---|
command | Required | String | It has the command to be executed to extract the element information for the selected application Ex:{"command": "getItems"} |
filter | Optional | Object: filter | Its an object that describes details to apply the filter. For more details filter object section.
|
Screen resolution
Name | Required | Type | Description |
---|---|---|---|
width | Required | Number | Screen width By default set to 1920 |
height | Required | Number | Screen height By default set to 1080 |
Provide stage Information of the running application.
Name | Required | Type | Description |
---|---|---|---|
id | Required | Number | stage id of the application |
pid | Required | Number | Process Id of the running application |
width | Required | Number | Screen Width By default screen width set to 1920 |
height | Required | Number | Screen height By default Screen height set to 1080 |
name | Required | String | Window name By default set to "" |
isActive | Required | Boolean | returns true if window is in active state else False |
scene | Required | String | scene name By default it is set to "" |
type | Required | String | type name By default it is set to "" |
Creates a top level window and accesses the screen information.
Name | Required | Type | Description |
---|---|---|---|
id | Required | Number | Provides the details of window id. Ex:"id": "11266048" |
width | Required | Number | Defines width of the screen. width:"1920" |
height | Required | Number | Defines the height of the screen. Ex:"height":1080 |
isVisible | Required | Boolean | Defines whether the window is visible on the screen. Ex:"isVisible": true |
activeFocusItem | Required | Number | The item which currently has active focus or null if there is no item with active focus. This property was introduced in Qt 5.1. Ex:"activeFocusItem": "26405216" |
x | Required | Number | Defines the window's position and size. The (x,y) position is relative to the Screen if there is only one, or to the virtual desktop (arrangement of multiple screens). Ex:"x":0 |
y | Required | Number | Defines the window's position and size. The (x,y) position is relative to the Screen if there is only one, or to the virtual desktop (arrangement of multiple screens). Ex:"y":0 |
isActive | Required | Boolean | Defines active status of the window. Ex:"isActive": true |
title | Required | String | The window's title in the windowing system. The window title might appear in the title area of the window decorations, depending on the windowing system and the window flags. It might also be used by the windowing system to identify the window in other contexts, such as in the task switcher. |
contentItem | Required | String | The invisible root item of the scene. Ex:"contentItem": "10875168" |
view | Required | Object: view | It is a class which provides a window for displaying a Qt Quick user interface. Ex:"view": { "source": "file:///usr/lib/qml/WebOSCompositorBase/main.qml"} |
Error Code | Error Text | Error Description |
---|---|---|
-1 | Parameter is missing | States that parameter with name <parameter name> is missed, need to specify required parameter |
-1 | Not a subscription message | Need to specify subscription message |
-1 | Command ID is invalid | Command ID is invalid, specify correct command |
-1 | Invalid Stage ID | Stage ID is invalid, Specify correct Stage ID |
-1 | Invalid application ID | States that invalid value assigned to appID, need to specify appID of the required application |
-1 | command name is not specified | Need to specify proper name of the command to be executed to get the element information |
-1 | command 'commandsBatch1' is unknown | specify the proper method name [Ex:commandsBatch] which executes the command specified to queue object |
-1 | Invalid JSON message | States that the provided input data is not in valid json format. |
Contents