QTP动态链接

时间:2013-07-09 07:49:27

标签: qtp

我有一个网页表,有很多动态链接。我需要点击我已经从网表中选择的特定链接。我尝试了很少的代码,但它们没有用,请给我一些有价值的解决方案。

Scheme = DataTable.Value("Scheme", "dtDataSheet")

If checkIfItemExistInWeblist(sScheme, Browser("ViewPortfolio").Page("AddTransaction").WebList("schemeId") Then
    Browser("View Portfolio").Page("Add Transaction").WebList("schemeId").Select sScheme
    Wait(5)
    sSchemeName = sScheme
End If

goToSchemePage(sSchemeName)

Function goToSchemePage(sSchemeName)    
    Dim oAnchor
    Dim blnFound
    Set oAnchors = Browser("AssetDetails").Page("AssetDetails").WebElement("SchemeLastNAVUnits/Avg.").Object.GetElementsByTagName("A") 

    blnFound = False
    For Each oAnchor in oAnchors
        If oAnchor.innertext = sSchemeName Then
            oAnchor.Click()
            blnFound = True
        End If
        Set oAnchor = Nothing

        If blnFound = True Then Exit For
    Next 'oAnchor

    Set oAnchors = Nothing
End Function

但它没有用,请为我提供有价值的解决方案。

0 个答案:

没有答案