1

こんにちは、以下のコードを使用して Web ページをテストしています。

ExecuteFile "H:\Asma\wp_CommonFunctions.vbs"

Set Brw_Composer = CreateObjectDescription("name:=Composer - Test Accounts")
Set Page_Composer = CreateObjectDescription("title:=Composer.*,url:=http://sharepoint.btfin.com.*")
Set tbl_Composer_HostBrand = CreateObjectDescription("html tag:=TABLE,Value:=36,text:=Host Brand.*,Enable Smart Identification:=True,rows:=16")
Set tbl_Composer_Environments = CreateObjectDescription("html tag:=TABLE,Value:=32")

BT_SVP_Path= "http://sharepoint.btfin.com/it/simt/home/environments%20tech/Composer/Test%
SystemUtil.Run BT_SVP_Path

' Get the value of CAN  under 
cellValue=Browser("Composer - Test Accounts").Page("Composer - Test Accounts").WebTable("Host Brand").GetCellData(12,4)

'Open SVP ACC2 Ingress link
'Set obj = Browser(Brw_Composer).Page(Page_Composer).Webtable(tbl_Composer_Environments)
If  (Browser(Brw_Composer).Page(Page_Composer).Webtable(tbl_Composer_Environments)).Exist Then
    msgbox" success"
else 
    msgbox "failure"
End If
'****************************************************************** 
Function CreateObjectDescription(StrProperties)
    Dim objDescription 
    Dim ObjArr 
    Dim PropCount
    Dim ObjProperty
    Set objDescription=Description.Create 
    ObjArr=split(StrProperties,",") 
    For PropCount=0 to ubound(ObjArr) 
        ObjProperty=split(ObjArr(PropCount),":=")
        objDescription(ObjProperty(0)).value=ObjProperty(1) 
    Next 
    Set CreateObjectDescription=objDescription
End Function

プロパティが実行時に指定されている場合、Webtables は実行時に識別されません。オブジェクト リポジトリにプロパティを追加すると、コードは正常に動作します。助けてください。Web アプリケーションのテストに IE 6 を使用しています。

4

1 に答える 1

0

オブジェクト リポジトリ (OR) 記述と記述プログラミング (DP) の主な違いは、OR はデフォルトで非正規表現であり、DP は正規表現であることです。

これが動作の違いの原因である可能性があります。その場合は、追加するだけです

objDescription(ObjProperty(0)).RegularExpression = False

もう 1 つの違いは、OR が時々使用する非表示のプロパティに関するものです。これが原因であるかどうかを確認するには、[ソース インデックスを使用して実行Tools -> Options -> Web -> Advanced] に移動し、チェックを外します (QTP11 を使用している場合は、自動 XPath 識別子を使用して学習して実行することもできます)。OR からの識別がまだ機能するかどうかを確認します。

OR と DP の間で動作がまだ異なる場合は、識別プロパティに違いがある可能性があります。

于 2012-04-19T07:26:44.343 に答える