QC OTA

Note: First make sure QTP connect to QC.(转自:http://blog.csdn.net/franktan2010/article/details/7243314)

27.1 QC Path:

QC path’s root folder is “Subject”. So all QC path startwith “[QualityCenter]Subject”. Set QC path into QTP’s Toolsà Options…àFolder(Tab)

QTP use QC paths:


DataTable.Import “[QualityCenter]Subject\Input\TestCase1.xls”

DataTable.ImportSheet “[QualityCenter]Subject\Input\TestCase1.xls”, “Global”, “Global”

ExecuteFile “[QualityCenter]Subject\ScriptConfiguration.vbs”

Note: QTP cannot use relative path, but you can write a function.

27.2 QCUtil Object

QCUtil Object provides the following properties:


Returns the Quality Center OTA Run object (QC: Test Plan).


Returns the collection of tests (QC: Test Lab).


Returns the Quality Center OTA TSTest object (QC: Test Lab).


Boolean value indicates whether QTP is currently connected to a QC.


Returns the Quality Center OTA QCConnection objectd


Returns the Quality Center OTA Test object (QC: Test Plan).

Example to use QCUtil object:


‘Are we connecting to QC?

IsQCConnected = Not (QCUtil.QCConnection Is Nothing)


‘Is the test stored in QC

IsTestPresentInQC = Not (QCUtil.CurrentTest Is Nothing)


‘Is the test running from QC

IsTestRunningFromQC = Not (QCUtil.CurrentRun Is Nothing)

 

27.3 QC Open Test Architecture (OTA)

即QCCOM, 略。最顶层是TDConnectionObject.TDConnection Object TDConnectionObject TDConnection Object TDConnection Object TDConnection Object

27.4 TDConnectionObject

If QC connected:


 


Set TDConnection = QCUtil.QCConnection

print TDConnection.Connected

 

If QC not connected:


Set qtApp = CreateObject("QuickTest.Application")

qtApp.Launch

qtApp.Visible = True

qtApp.TDConnection.Connect "http://qcserver ", _
              "MY_DOMAIN", "My_Project", "James", "not4you", False

If qtApp.TDConnection.IsConnected Then

print "Connect to qc is successful" & qtApp.TDConnection.User & “log in”

End if

27.4 TheCommand and Recordset  Object

The Command and Recordset object allow us to get data from QC DB.

Note:注意DB返回数据的格式,如果是HTML格式,就得再写一个fucntion转换成plainText格式。


‘Get the TD OTA object reference

Set TDConnection = QCUTil.QCConnection

‘Get the ID of the current test in the Data base

TestID = QCutil.CurrentTest.Field ("TS_TEST_ID")

‘Get all the design steps present in the Test and

‘read the Step Description and Expected Text

Set TDCommand = TDConnection.Command

TDCommand.CommandText =  _

"Select DS_DESCRIPTION, DS_EXPECTED From DESSTEPS where DS_TEST_ID = " & TestID

‘Execute the query

Set TDRes = TDCommand.Execute

‘Loop throuh all the results in the recordset

While Not TDRes.EOR

Msgbox TDRes.FieldValue("DS_DESCRIPTION")

Msgbox TDRes.FieldValue("DS_EXPECTED")

TDRes.Next

Wend

27.5  The AttachmentFactory Collection

AttachmentFactory collection can access attachments present in thefollowing object:


Requirement Tab;


Test Plan Tab: Folder, Test, Design steps;


Test Lab Tab: Folder, Test, TestSet, TestRun, TestStep


Defect;

Here is the example to get attachment:


Set oAttachments = FromPlace.Attachments

‘Get a collection of all attachments present

Set allAttachment = oAttachments.NewList("")

For Each oAttachment In allAttachment

‘process each attachments

Next

Download attachment as the “process each attachments” (above)


Set FSO = CreateObject("Scripting.FileSystemObject")

oAttachment.Load True,""

‘Copy the file from temporary downloaded location to the TOPlace folder

FSO.CopyFile oAttachment.FileName, _

TOPlace & oAttachment.Name(1),True

27.6  Simple way to download files from QC:PathFinder & Locate method

Note: 1PathFinder based on the folders specified in the Folder Tab (ToolsàOptionàFolders)

             2 The method only used on foldersor tests present in the test plan tab

             3 If QTP local temporary fileshave same name file, will not download. So clear                              temporary files beforedownload.

sFilePath = PathFinder.Local(“QCcommon.vbs”)

‘Or full path

sFilePath = PathFinder.Local(“[QualityCenter] Subject\AllTest\QCcommon.vbs”)

27.7  Uploading attachment to QC


  ‘Get attachments (AttachmentFactory)

Set oAttachments = QCUtil.CurrentTest.Attachments

‘Now just upload the new one

Set oNewAttachment = oAttachments.AddItem(Null)

oNewAttachment.FileName = NewFileName

oNewAttachment.Type = 1 ‘TDATT_FILE

oNewAttachment.Post

 

27.8  Getting the Current Test location


‘Function to get the current test path is running from

Public Function GetCurrentTestPath()

GetCurrentTestPath = ""

‘The test in not in QC

If QCUtil.CurrentTest is Nothing Then Exit Function

‘Get the test name

testName = CurrentTest.Name

‘Get the ID of the parent folder

parentFolderID = CurrentTest.Field("TS_SUBJECT").NodeID

‘Get the complete path of parent folder

parentFolderPath = QCUtil.QCConnection.TreeManager.NodePath(parentFolderID)

GetCurrentTestPath = parentFolderPath & "" & testName

End Function

 

27.9 Gettingthe Current Test Set Location:


‘Path for the folder where the Test Set exists

testSetFolder = QCUtil.CurrentTestSet.TestSetFolder.Path

 

27.10Enumerating all the tests in test lab tab

The Test Lab folderstructure is managed by TestSetTreeManager object. TestSet object are managedby TestSetFactory object, Each TestSet object contains test managed byTSTestFactory object.


--TestSetFactory –TestSet –ConditionFactory –Condition

--TSTestFactory--TSTest--RunFactory


--TestSetTreeManager--TestSetFolder—TestSetFactory

Here is the sample code:


‘This function can be used to enumerate all the test present inside a testSet.

Set allTests = oTestSet.TSTestFactory.NewList("")

For each oTest in allTests

Print "Test - " & oTest.name

Next

 


Function EnumerateAllTestSets(ByVal FolderPath)

‘Check if the folder object has been passed or a string path

If isObject(FolderPath) Then

Set oTestSetFolder = FolderPath

ElseIf FolderPath = "" or LCase(FolderPath) = "root" then

‘Root folder needs special handling

Set oTestSetFolder = QCUtil.QCConnection.TestSetTreeManager.Root

Else

‘Get the object from the path

Set oTestSetFolder = QCUtil.QCConnection.TestSetTreeManager.NodeByPath(FolderPath)

End If

‘A root folder cannot have any test set. So we need not check

‘for any testsets in case of the Root Folder.

If oTestSetFolder.name <> "Root" Then

Print oTestSetFolder.Path

‘Loop through all the test sets present in the folder

Set allTestSets = oTestSetFolder.TestSetFactory.NewList("")

For each oTestSet in allTEstSets

Print "Test Set - " & oTestSetFolder.Path & "" & oTestSet.Name

‘Call another function to enumerate all the test inside the current test set

EnuemrateTestInTestSet oTestSet

Next

End If

 

27.11Enumerating all the tests in test plan tab

QC OTA model’s TreeManager object manage the folderstructure of test plan tab. Each folder contains folders/tests. Tests aremanaged by a TestFactory object.


--TestFactory--Test--DesignStepFactory--DesignStep


--TreeManager--SysTreeNode

Here is the sample code:


Public Function EnumerateAllTestsinTestPlan(ByVal folderPathOrObject)

If IsObject(folderPathOrObject) Then

‘We already have a reference to the folder object

Set oTestPlanFolder = folderPathOrObject

ElseIf folderPathOrObject = "" or lcase(folderPathOrObject) = "subject" Then

‘Get the root subject folder

Set oTestPlanFolder = QCutil.QCConnection.TreeManager.NodeByPath("Subject")

Else

‘Get the folder using the string path

Set oTestPlanFolder = QCUTil.QCConnection.TreeManager.NodeByPath(folderPathOrObject)

End If

‘And then use NewList on that object to get the collection of tests present in the folder

Set oTestFactory = oTestPlanFolder.TestFactory.NewList("")

For each oTest in oTestFactory

MsgBox oTestPlanFolder.Path & "" & oTest.Name

Next

‘Recursively call this function for each sub folder

Set allSubFolders = oTestPlanFolder.NewList()

For each oFolder in allSubFolders

EnumerateAllTestsinTestPlan oFolder

Next

End Function

时间: 2024-07-31 07:08:03

QC OTA的相关文章

NB-IOT的OTA测试(功率、灵敏度测试)

2017年7月25日新益技术实现了NB-IoT终端系统测试,在OTA暗室中完成了NB-IoT终端系统总辐射功率TRP(TotalRadiated Power)和总全向灵敏度TIS(Total Isotropic Sensitivity)测试.测试得到的360度全方位辐射和接收性能参数,为NB-IoT产品推向市场提供重要的参考数据. 关于NB-IoT通常一项通信技术从诞生到发展成熟需要4~5年的发展周期,NB-IoT从15年下半年到现在只经过两年就得到业界普遍认可,在国内更是涌现出芯片,模组和终端

固件空中升级(OTA)与固件二次引导的原理和设计

蓝牙固件空中升级(OTA)涉及到蓝牙无线通信.固件外存分布.固件内存分布(定制链接脚本).固件二次引导等技术,须要开发者深入理解蓝牙单芯片的存储架构.启动引导流程.外存设备驱动和产品电路设计等领域知识.完整和完美地设计和实现OTA,是一名嵌入式物联网软件project师最好的技术体现. 本文以Dialog公司研发的号称全球最低功耗蓝牙单芯片DA14580平台为基础进行分析和设计,但设计思想能够推广到其它蓝牙单芯片平台,甚至也适用于wifi固件空中升级. 一.OTA意义 固件空中升级是如此重要,在

QC的使用简介

目录一.站点管理员的操作(后台)1.登录2.创建域3.创建项目4.新建用户5.QC的一些其他信息的修改(非 常用)二.项目管理员对项目的配置管理(前台)1.登录2.修改用户个人信息及密码3.项目成员设置4.用户组的设置5.项目数据的设置(customize projecct entities)6.项目数据列表(customize project lists)三.普通用户对项目的操作(前台)1.登录2.对需求的操作3.对用例的操作4.执行测试5.缺陷报告6.从Excel导入数据到QC 一.站点管理

史上最全QC学习方案,值得收藏!

Quality Center是一个基于Web的强大的测试管理工具,可以组织和管理应用程序测试流程的所有阶段,**制定测试需求.计划测试.执行测试和跟踪缺陷.此外,通过Quality Center还可以创建报告和图来监控测试流程.合理的使用Quality Center可以提高测试的工作效率,节省时间,起到事半功倍的效果. Quality Center的前身就是大名鼎鼎的TD,也就是TestDirector,所以在很多测试资料中,大家看到的TD资料,其实也可以用作学习QC的参考啦! QC可以说是软件

你还没成为Delphi QC的成员吗?(转红鱼儿)

Delphi很早就建立了quality.embarcadero.com,简称为QC,质量控制中心,用来接收用户反馈的bug,新功能建议等,是开发者与delphi官方直接交流的平台.无论是否为正版用户,都可以注册账号并反馈bug. 不论你是delphi开发者还是喜欢者,粉细,如果还没有注册为QC的成员,真是件遗憾的事情,或者说,不是一名合格的Delphi fans. 我也是最近才喜欢这个QC的,这得感谢老猫,是他通过提交bug才引我去关注QC的,并且越用越喜欢.为什么呢? 第一,经常浏览QC,你会

QC安装失败问题1

QC安装失败问题:一.现象:报错:密码太短,不符合Windows安全策略解决方法:1.在控制面板——添加删除程序中删除QC 2.打开程序--管理工具--域安全策略--安全设置--帐户策略--密码策略-密码必须符合复杂性要求--将“已启用”改为“已禁止” 3.重新安装二.现象:报错:执行select * into admin from gcsiteadmin.td.admin fail 找不到对象“gcsiteadmin.td.admin”解决方法:1.登录sql server 将所有gcsite

OTA Update官方文档(二,OTA 打包工具)

写在前面: OTA打包工具ota_from_target_files(build/tools/releasetools/目录下)可以为我们创建两种类型的更新包:整包和增量包.打包工具一般来说会对我们称之为目标文件(target-files.zip)进行打包,该目标文件是有Android编译系统产生,通常可在终端下使用make otapackage生成. 一.整包升级 一个整包包含了Android设备的整个终态(system/boot/recovery分区),只要设备可以接收更新包并且进入reco

前端Mvvm QC 上传了测试版

QC是一个前端MVVM框架,适合用来构建复杂的业务逻辑 项目地址:https://github.com/time-go/qc 技术支持QQ群:330603020 QC特点: 1.良好的浏览器兼容性(兼容IE8) 2.强大的组件化支持 3.卓越的性能 4.数据智能补齐5.灵活的自定义事件 6.自动特殊字符转义 QC依赖哪些文件 大家把代码当下来后 js文件  qc.js 就是我们要引用的文件  event.js 是对移动端事件tap和longtap的扩展这个可以不易用 tool文件夹   inde

使用浏览器内核爬取OTA数据

因为业务需要,所以会有一些爬虫的设计需求. 目前这一部分的内容都是外包项目,领导说需要根据实际情况,研究一下自己研发的可能性. 但是绝大部分这些OTA网站都做了大量的异步加载,并且接口都做了加密处理. 也就是说,我们从控制台上面拦截下来的请求数据都是加密的数据,只有经过页面客户端解析后的数据,才能真正的渲染成我们想要的页面. 因此,为了能够正确地抓取到这些数据,我们必须使用浏览器内核来实现. 现在常用的浏览器内核工具有: QtWebkit spynner selenium 但是由于seleniu