51Testing软件测试论坛

 找回密码
 (注-册)加入51Testing

QQ登录

只需一步,快速开始

微信登录,快人一步

查看: 2150|回复: 5
打印 上一主题 下一主题

[原创] 哪位在Mercury support注册过的朋友帮忙找几篇文章

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2006-4-24 15:59:51 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
看到这样一篇文档
http://us.mercurybtonews.com/e_article000562179.cfm?x=b790MmS,b2ylQnnG
对文末提到的其他几篇文档感兴趣,但是因为使用的是试用版,恐怕没有注册customer support的权限,哪位使用正版的帮忙找下这几篇文档贴一下好吗,多谢了!
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

该用户从未签到

2#
发表于 2006-4-24 18:05:01 | 只看该作者
原帖由 aries1979 于 2006-4-24 15:59 发表
看到这样一篇文档
http://us.mercurybtonews.com/e_article000562179.cfm?x=b790MmS,b2ylQnnG
对文末提到的其他几篇文档感兴趣,但是因为使用的是试用版,恐怕没有注册customer support的权限,哪位 ...


试用版不能用CSO么??
回复 支持 反对

使用道具 举报

该用户从未签到

3#
发表于 2006-4-24 18:05:51 | 只看该作者
Products: Mercury QuickTest Professional 5.x and Mercury QuickTest Professional 6.x      

Issue:  How to use Excel objects in a QuickTest Professional test

Solution: Refer to Microsoft`s MSDN Library for a complete listing of Excel Object`s methods and properties

You can refer to "Microsoft Excel 2000 Visual Basic for Applications object model" for a complete listing of Excel methods and properties that can be used within a QuickTest Professional (QTP) script. You can use these Excel object methods within a QTP script to create workbooks, create new sheets, input data, etc.
For a complete listing of Excel object's methods and properties, refer to MSDN Library - Microsoft Excel Object Model  (http://msdn.microsoft.com/librar ... elApplication.asp).
The following is a sub-procedure that uses Excel object methods to output data from a dictionary object to an Excel file. Attached you will find a working example of a QuickTest Professional test that uses the sub-procedure below. The example will retrieve information from a webpage and output it to an Excel file (info.xls) using the ReportInformation sub-procedure.
In order to run the test, unzip the attached file to a temporary folder, and start QTP with web support loaded:
CPT31467.zip
Example:
   Sub ReportInformation(dictionary, filename)
     ' create the Excel object
     Set ExcelObj = CreateObject("Excel.Application")

     ' add a new Workbooks and a new Sheet
     ExcelObj.Workbooks.Add

     Set NewSheet = ExcelObj.Sheets.Item(1)
     NewSheet.Name = "Page Information"

     ' loop through all the information in the Dictionary object
     ' and report it to the Excel sheet
     row = 1

      For Each key In dictionary.keys
         NewSheet.Cells(row,1) = key
         NewSheet.Cells(row,2) = dictionary(key)
         row = row + 1
      Next

      ' customize the Sheet layout
      NewSheet.Columns("A:A").ColumnWidth = 20
      NewSheet.Columns("A:A").Font.Bold = True
      NewSheet.Columns("B:B").ColumnWidth = 60
      NewSheet.Columns("B:B").HorizontalAlignment = -4108 ' xlCenter

      ' save the Excel file
      ExcelObj.ActiveWorkbook.SaveAs filename

      ' close the application and clean the object
      ExcelObj.Quit
      Set ExcelObj = Nothing
    End Sub

Note:
Excel's object methods are not part of QuickTest Professional, therefore, they are not guaranteed to work and are not supported by Mercury Technical Support. Any changes that Microsoft may make to these methods are not the responsibility of Mercury.

Login to Mercury Customer Support to access these Related articles:
Problem ID 34574 - How to add cells, rows, or columns to an Excel document
Problem ID 28214 - How to get data from an Excel file without importing the data to the data table
Problem ID 41551 - How to run an Excel macro from QuickTest Professional
Problem ID 28332 - How to write data to an Excel file without importing the data to the data table
Problem ID 44128 - How to set the number format of cells in an Excel file
Problem ID 43591 - How to hide/display columns or rows in an Excel document
Problem ID 43589 - How to change the font and cell color in an Excel document
Problem ID 43645 - How to add formatting to the cell in an Excel document




» Printer Friendly Version
回复 支持 反对

使用道具 举报

该用户从未签到

4#
 楼主| 发表于 2006-4-25 13:29:46 | 只看该作者
谢谢版主,不过我要的是后面提到的几篇文档,谢谢
Problem ID 34574 - How to add cells, rows, or columns to an Excel document
Problem ID 28214 - How to get data from an Excel file without importing the data to the data table
Problem ID 41551 - How to run an Excel macro from QuickTest Professional
Problem ID 28332 - How to write data to an Excel file without importing the data to the data table
Problem ID 44128 - How to set the number format of cells in an Excel file
Problem ID 43591 - How to hide/display columns or rows in an Excel document
Problem ID 43589 - How to change the font and cell color in an Excel document
Problem ID 43645 - How to add formatting to the cell in an Excel document

因为注册CUSTOMER SUPPORT要一个什么号,应该是只有正版的才行
回复 支持 反对

使用道具 举报

该用户从未签到

5#
发表于 2006-4-26 13:55:58 | 只看该作者
Problem ID: 43645

--------------------------------------------------------------------------------
Product:
QTP Version N/A
Ext(s):
Add-in Not Applicable


Topics:
Actions and External Libraries Problems or Questions
VBScript Problems, Questions, or Examples
OS:
Any Windows Platform

Creation Date:
14 Dec 2005  Last Modified Date:
15 Dec 2005



--------------------------------------------------------------------------------

Problem Description: How to add formatting to the cell in an Excel document




--------------------------------------------------------------------------------

Solution: Formatting Excel output from QuickTest Professional

You can use the Excel object model to automate formatting the values in a cell in an Excel worksheet. For more information on using the Excel object model with QuickTest Professional, refer to Problem ID 31468 - How to use Excel objects in a QuickTest Professional test.

Example:
filename = "C:\temp\Book1.xls"

Set ExcelObj = CreateObject("Excel.Application")
ExcelObj.Workbooks.Open filename
Set NewSheet = ExcelObj.Sheets.Item(1)

' Add the text - format bold
NewSheet.Cells(1,2) = "Hello From QTP!"
NewSheet.Cells(1,2).Font.Bold = true

' Add the text - format color
NewSheet.Cells(2,2) = "Hello From QTP!"
NewSheet.Cells(2,2).Font.Color = RGB(0, 0, 255)

' Add the text - format italic
NewSheet.Cells(3,2) = "Hello From QTP!"
NewSheet.Cells(3, 2).Font.Italic = true

' Add the text - format size
NewSheet.Cells(4,2) = "Hello From QTP!"
NewSheet.Cells(4, 2).Font.Size = 25

' Add the text - format Strikethrough
NewSheet.Cells(5,2) = "Hello From QTP!"
NewSheet.Cells(5, 2).Font.Strikethrough = true

' Add the text - format underline
NewSheet.Cells(6,2) = "Hello From QTP!"
NewSheet.Cells(6, 2).Font.Underline = true

' Add the text - format Subscript
NewSheet.Cells(7,2) = "1st test"
NewSheet.Cells(7, 2).Characters(2, 2).Font.Subscript = True

' Add the text - format Subscript
NewSheet.Cells(8,2) = "1st test"
NewSheet.Cells(8, 2).Characters(2, 2).Font.Superscript = True

ExcelObj.ActiveWorkbook.Save
ExcelObj.Application.Quit
Set ExcelObj = Nothing


Related articles:
Problem ID 31468 - How to use Excel objects in a QuickTest Professional test
Problem ID 34574 - How to add cells, rows, or columns to an Excel document
Problem ID 28332 - How to write data to an Excel file without importing the data to the data table
Problem ID 28214 - How to get data from an Excel file without importing the data to the data table
Problem ID 43589 - How to change the font and cell color in an Excel document
Problem ID 43591 - How to hide/display columns or rows in an Excel document
回复 支持 反对

使用道具 举报

该用户从未签到

6#
发表于 2006-4-26 14:34:37 | 只看该作者
点我签名上的link

自己翻吧。呵呵。

BTW,从后往前翻比较好。呵呵。

[ 本帖最后由 lovetest6 于 2006-4-27 10:01 编辑 ]
回复 支持 反对

使用道具 举报

本版积分规则

关闭

站长推荐上一条 /1 下一条

小黑屋|手机版|Archiver|51Testing软件测试网 ( 沪ICP备05003035号 关于我们

GMT+8, 2024-5-22 16:48 , Processed in 0.077882 second(s), 27 queries .

Powered by Discuz! X3.2

© 2001-2024 Comsenz Inc.

快速回复 返回顶部 返回列表