![]() ![]() serialNo ) print ( "Custom Properties:" ) print ( " myString = " + mobile. softwareVersion ) print ( " scription = " + mobile. hardwareVersion ) print ( " device.softwareVersion = " + mobile. serialNo ) print ( " device.hardwareVersion = " + mobile. category ) print ( " rialNo = " + mobile. scriptIndex ) print ( "- Create Mobile test object -" ) mobile = Mobile ( session, "Mobile" ) print ( "- Mobile test object info -" ) print ( " id = " + mobile. session is not None : print ( "Script was started by the manager:" ) print ( " = " + session. storageBasePath ) print ( " = " + session. scriptsBasePath ) print ( " = " + session. storagePath ) print ( " info.tester = " + session. scriptFileName ) print ( " info.storagePath = " + session. scriptFilePath ) print ( " info.scriptFileName = " + session. get ( 'dummy' ))) print ( "Session info:" ) print ( " info.scriptFilePath = " + session. customProperties )) print ( " dummy = " + str ( session. myString ) print ( " myNumber = " + str ( session. get ( 'dummy' ))) print ( "Custom Properties:" ) print ( " myString = " + session. parameters ) print ( " dummy = " + str ( session. session print ( "- Parameter and Custom properties -" ) print ( "Parameters:" ) print ( " param1 = " + session. message ) Sample script python (sample.py) import sys import time from testwizard.test import TestWizard from testwizard.test import ResultCodes from testwizard.mobile import Mobile from t_top_box import SetTopBox with TestWizard () as TW : session = TW. setResult: reports a pass / fail /error and posts it to the server.addPass / addFail: reports a pass or fail but does not post it to the server.The outcome of a script run can be either Pass, Fail or Error.ĭuring a script run multiple results can be reported, this can be done in 2 different ways: scriptIndex: The index of the script within the session.id: The unique identifier of the session in the manager.ssion (optional: only when run from within the manager).testWizardVersion: The version of testwizard being used.ocrEngine: The name of the ocr engine being used.storageBasePath: The root directory where the output is written.scriptsBasePath: The root directory where all scripts are stored.storagePath: The directory where the output will be written.scriptFileName: The file name of the script file.scriptFilePath: The full path of the script file.More information about the session can be read from the info attribute: At this point the resources will be released and available for other script runs. The session is destroyed when the script ends. If any of the resources is allready in use, a session cannot be setup and an error will be thrown. When the script is executed (run or debug), a new session is created, and all resources will be locked If a different location is preferred, this can be configured in the outputfolder attribute. When running a test all actions are logged (testrun.log) and so is the result (result.log).īy default the location of these files is a timestamp based folder within the runs folder. customProperties testObjectProperty = mobile. These custom properties can be accessed from within a script. initDriver () CustomPropertiesĬustom properties are maintained in the Testwizard manager and can be set on Sessions and TestObjects. mobile = Mobile ( session, "Mobile" ) result = mobile. ![]() ![]() To execute a command on a testobject it must be referenced (constructed), when doing this, the name of the resource will be used, while the id corresponds to the actual device. parameters ResourcesĪll resources will be acquired (and thus locked) at the start of a test run and will be released when the script ends. outputFolder: The folder where the log files should be written (optional)Įvery parameter will be made available as a field of the session object.category: The category of the testobject.customProperties: An object holding the custom property values (optional).parameters: An array of parameters (optional).tester: The name of the tester (optional).This json file has the following attributes: json extension.Ī command-line-argument (-sidecar or -s) can be used to instruct the usage of a different file. īy default the name of the sidecar file is the same as this script, but with a. To enable this from any IDE a sidecar file (in json format) is used. The testwizard manager enables a single script to be run on different devices with (optionally) different sets of parameters. Use this package in combination with one (or more) of the specific device packages Sidecar file Python language support for testing different kinds of devices using testwizard Usage ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |