<ruby id="h6500"><table id="h6500"></table></ruby>
    1. <ruby id="h6500"><video id="h6500"></video></ruby>
          1. <progress id="h6500"><u id="h6500"><form id="h6500"></form></u></progress>
            • 軟件測試技術(shù)
            • 軟件測試博客
            • 軟件測試視頻
            • 開(kāi)源軟件測試技術(shù)
            • 軟件測試論壇
            • 軟件測試沙龍
            • 軟件測試資料下載
            • 軟件測試雜志
            • 軟件測試人才招聘
              暫時(shí)沒(méi)有公告

            字號: | 推薦給好友 上一篇 | 下一篇

            如何在QTP Extensibility Accelerator 自定義Web Add-in對象添加識別屬性

            發(fā)布: 2010-11-24 12:17 | 作者: 網(wǎng)絡(luò )轉載 | 來(lái)源: 領(lǐng)測軟件測試網(wǎng)采編 | 查看: 209次 | 進(jìn)入軟件測試論壇討論

            領(lǐng)測軟件測試網(wǎng)

              在界面上添加“屬性”,在javascript的方法 get_property_value 中添加代碼返回相應的值即可,例如

              function get_property_value(property)

              {

              if (property == "outertext") { //自己重寫(xiě)基類(lèi)的outertext屬性

              return _elem.outerText;

              }

              else if (property == "rowindex") { //對自己新加的屬性的

              return getRowIndex();

              如果希望繼承的基類(lèi)的原有Identification Properties也可以用,就也需要添加上屬性,但不需要在get_property_value那里處理。比如繼承自WebElement的自定義對象,要原有的outertext屬性也可以用時(shí),就需要添加一個(gè)名字為outertext的屬性給你的新類(lèi)?梢栽诮缑嫔咸砑,不可以控制某些屬性的時(shí)候,可能需要手工編輯對應的“*TestObjects.xml” 文件吧,那個(gè)配置文件指定了你的自定義對象的屬性和方法等。

              注意: 屬性最好返回string的字符串類(lèi)型,在javascript用var i=3; i.toString()轉換一下。我發(fā)現返回數字類(lèi)型的時(shí)候在qtp的“描述式編程”(Programmatic Descriptions)方式在代碼里面指定對象的話(huà),整型數的屬性使用不了。

              ===============================================

              HP QTP 文檔

              Implementing Support for Identification Properties

              In the test object configuration file you defined the identification properties for your test object classes. When QuickTest runs a test it needs to retrieve the values for these properties. QuickTest uses identification property run-time values in different test object methods, such as GetROProperty. Identification property run-time values are also required for different basic capabilities, such as creating checkpoints and outputting values.

              To support retrieving the run-time values of identification properties, you need to implement a JavaScript function that accepts a PropertyName parameter and returns the value of any property QuickTest requests. (QuickTest uses only lowercase letters in identification property names. If the identification property name in the test object configuration file contains uppercase letters, they are converted to lowercase.)

              This function must return the property value in one of the following formats: String, Integer, Boolean, or array. When returning an array, use the toSafeArray function to convert the array to the format that QuickTest expects. When you provide an identification property value in an array format, QuickTest converts the array to a semicolon-delimited string.

              For more information on writing JavaScript functions for Web Add-in Extensibility, see Designing JavaScript Functions for Your Toolkit Support Set.

              QuickTest uses the base test object class implementation to retrieve the identification property values when the following conditions are met:

              The control includes a base element (for more information, see Extending an Existing Test Object Class).

              The identification property is defined in the test object configuration file with the same name as a base test object class property.

              You do not provide a function that returns a value for that identification property.

              Implement your JavaScript function to return a value for the identification properties defined in the test object configuration file in the following situations:

              Base test object class implementation for retrieving the value for this identification property value is not available.

              The base test object class implementation does not meet your needs.

              By designing the function that returns identification property values to return a value for the logical_name property, you can control how QuickTest names test objects of this test object class. For more information, see Customizing the Test Object Name.

              In the toolkit configuration file, you can specify the JavaScript file in which you implemented the JavaScript function that retrieves property values. You can also specify the name of the function that you implemented for this purpose (in theControl\Run\Properties element). However, if you do not specify a function name, QuickTest callsget_property_value (PropertyName) and this is the function that you must implement. If you do not specify a file name, QuickTest calls the function from the default JavaScript file you specified in the Control\Settings element (at the test object class level) or in the Controls\Settings element (at the toolkit level). For more information, see the Toolkit Configuration Schema Help.

              After you create support for retrieving the run-time values of identification properties, you can test that your toolkit support set correctly enables QuickTest to run checkpoints on your Web elements, output property values, display the property values in the Object Spy, and run test steps with the GetROProperty operation. For more information on testing your toolkit support set, see Testing the Toolkit Support Set During Development.

            延伸閱讀

            文章來(lái)源于領(lǐng)測軟件測試網(wǎng) http://kjueaiud.com/

            TAG: qtp QTP web Web WEB 定義 屬性 Accelerator


            關(guān)于領(lǐng)測軟件測試網(wǎng) | 領(lǐng)測軟件測試網(wǎng)合作伙伴 | 廣告服務(wù) | 投稿指南 | 聯(lián)系我們 | 網(wǎng)站地圖 | 友情鏈接
            版權所有(C) 2003-2010 TestAge(領(lǐng)測軟件測試網(wǎng))|領(lǐng)測國際科技(北京)有限公司|軟件測試工程師培訓網(wǎng) All Rights Reserved
            北京市海淀區中關(guān)村南大街9號北京理工科技大廈1402室 京ICP備2023014753號-2
            技術(shù)支持和業(yè)務(wù)聯(lián)系:info@testage.com.cn 電話(huà):010-51297073

            軟件測試 | 領(lǐng)測國際ISTQBISTQB官網(wǎng)TMMiTMMi認證國際軟件測試工程師認證領(lǐng)測軟件測試網(wǎng)

            老湿亚洲永久精品ww47香蕉图片_日韩欧美中文字幕北美法律_国产AV永久无码天堂影院_久久婷婷综合色丁香五月
              <ruby id="h6500"><table id="h6500"></table></ruby>
              1. <ruby id="h6500"><video id="h6500"></video></ruby>
                    1. <progress id="h6500"><u id="h6500"><form id="h6500"></form></u></progress>