Micro Focus QTP (UFT) Forums
WebEdit box - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: WebEdit box (/Thread-WebEdit-box)



WebEdit box - mv8167 - 01-13-2012

I am using the following:

Code:
blFlagM4 =  .WebEdit("RepCode").Exist(0)
Even though the RepCode is not found (by my eye) the flag always gets set to True.

So I tried:

Code:
blFlagM4 =  .WebEdit("RepCode", "visible:=True").Exist(0)

But this errors out.

How can i change:
Code:
blFlagM4 =  .WebEdit("RepCode").Exist(0)
so that it wont come up as True if RepCode is really not there? lol


RE: WebEdit box - vIns - 01-14-2012

Hey lorena,
do u say it is hidden , but it still returns true?

If yes,
Code:
If Browser().Page().WebEdit().GetROProperty("x") = 0 and Browser().Page().WebEdit().GetROProperty("y") = 0  then
         ' it is hidden. but qtp will still return as true. so add ur code here

Else
          ' it is not hidden. so lets highlight where it is
            Browser().Page().WebEdit().highlight
End If



RE: WebEdit box - sshukla12 - 01-16-2012

Hi,

Instead of checking for .Exist() go for the property to check if it is hidden or not because sometimes object are not visible but they are hidden, I also face the same problem in one of my application.

Regards,
Sankalp


RE: WebEdit box - mv8167 - 01-18-2012

Thx vIns and you to Sankalp. But these did not work

This is a cut of my code (notice the flags dont match but the acrually do elsewhere)

-------------
Code:
blFlagD3 = .WebElement("Branch").Exist(0)
blFlagE1 = .WebElement("WebTable_AccountNo").Exist(0)
blFlagE2 = .WebElement("StartDate").Exist(0)
blFlagE3 = .WebCheckBox("CheckboxSave1").Exist(0)
blFlagE4 = .WebList("Select_Start_Month").Exist(0)
blFlagF1 = .WebElement("WebTable_AccountNo").Exist(0)
blFlagF2 = .WebElement("Select Tax Year").Exist(0)
blFlagF3 = .WebList("Select_Tax_Year").Exist(0)
blFlagG1 = "ALL IMAGED CLIENT DOCUMENTS"
blFlagH1 = .WebElement("WebTable_ImageAccess").Exist(0)
blFlagH2 = .WebEdit("SubFirm").Exist(0)
blFlagH3 = .WebElement("StartDate").Exist(0)
blFlagH4 = .WebElement("Branch").Exist(0)
blFlagJ1 = "ALL DOCUMENTS BY ACCOUNT TYPE"

blFlagI1 = .WebTable("Image Access_2").Exist(0)
blFlagI2 = .WebEdit("SubFirm").Exist(0)
blFlagI3 = .WebElement("Branch").Exist(0)
blFlagI4 =  .WebEdit("StartDate").Exist(0)
blFlagI5 =  .WebEdit("EndDate").Exist(0)



'Check for Errors or Missing Data
Call ErrorChecking (SectionLink, GroupName, ReportName, absX, absY, ExitFunction, GrC)
        If ExitFunction = 1 Then
            Exit Function
        End If

Wait (1)
'Search Preference Dialog Box K -- Like "INVENTORY REPORT BY SUB/INV NO"
        If blFlagK1="True" AND blFlagK2="True" AND blFlagK3="True" AND blFlagK4="True" AND blFlagK5="True" AND blFlagK6="True" Then
                Call NegativeDateTestingWith2DateThenAddDate (GroupName, ReportName, absX, absY, "K")
                'Call ReportK (SectionLink, GroupName, ReportName, absX, absY, GrC) 'NOT CREATED YET
                Call CloseDialogBox
                Exit Function
        End If

'Search Preference Dialog Box L -- Like "Branch Reporting"
        If blFlagL1="True" AND blFlagL2="True" AND blFlagL3="True" AND blFlagL4="True" AND blFlagL5="True" AND blFlagL6="True" Then
                Call NegativeDateTestingWith2DateThenAddDate (GroupName, ReportName, absX, absY, "L")
                'Call ReportL (SectionLink, GroupName, ReportName, absX, absY, GrC) 'NOT CREATED YET
                Call CloseDialogBox
                Exit Function
        End If

'Search Preference Dialog Box M -- Like "TRADE BLOTTER REPORTS BY ACCOUNT"  *** **  same a Report I   ???
        If blFlagM1="True" AND blFlagM2="True" AND blFlagM3="True" AND blFlagM4="True" AND blFlagM5="True" AND blFlagM6="True" Then
'                Call NegativeDateTestingWith2DateThenAddDate (GroupName, ReportName, absX, absY, "M")
'                Call ReportM (SectionLink, GroupName, ReportName, absX, absY, GrC) 'NOT CREATED YET
                Call CloseDialogBox
                Exit Function
        End If
-------------

For report M, all 5 flags get set even though flag 4 is not seen or found on the dialog box.

see attachment ;-)