Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Check existence of web objects on page
#4
Solved: 10 Years, 9 Months, 4 Weeks ago
See if this works,

Code:
Dim QuoteName
Set QuoteName = Browser("IPSDK WEB GUI (Search)").Page("Customer Info").Frame("Quote Header").Table("Quote_Header_Table").WebEdit("Quote_Name")

If ExistsAndDisabled(QuoteName) Then

Reporter.ReportEvent micPass, "Checking Object Status", QuoteName.GetTOProperty("html id") & " was found and disabled."
Else

Reporter.ReportEvent micFail, "Checking Object Status", QuoteName.GetTOProperty("html id") & " was either not found or disabled."
Quote_Name=QuoteName.GetROproperty("value")
Quote_Name_value = DataTable.Value("Quote_Name", GLOBAL)
CheckValue Quote_Name, Quote_Name_value
End If

Public Function ExistsAndDisabled(test_object)
ExistsAndDisabled=True
If test_object.Exist Then
If test_object.GetROProperty("enabled")= "True" Then
ExistsAndDisabled=False
End If
Else
ExistsAndDisabled=True
End If
End Function

Public Function CheckValue(str1, str2)
If strcomp (str1, str2) =0 Then
Reporter.ReportEvent micPass, "Checking object value", str1 & "was found"
End If
End Function
Honestly, i dont have the time to refine your function, however the above should work for your tweaked purpose. I will try and work on it during my free time, however no promises Smile
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Reply


Messages In This Thread
Check existence of web objects on page - by eltee - 03-16-2011, 02:43 PM
RE: Check existence of web objects on page - by basanth27 - 03-16-2011, 03:14 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
Smile If Then Is Always True For Web Objects zunebuggy 1 794 04-17-2020, 04:30 AM
Last Post: zunebuggy
  click each web link in a page using Index or other method in QTP smeijer 13 23,754 04-29-2017, 04:53 PM
Last Post: kowshik
  VB Script to count number of links in a web page. Suma Parimal 4 24,819 07-01-2015, 12:59 PM
Last Post: govind
  How to connect two web element objects? zawarepradeep@gmail.com 1 2,543 07-23-2014, 11:23 PM
Last Post: Ankur
  Spy is not deteting Web objects ssandula 0 1,834 11-25-2013, 04:33 PM
Last Post: ssandula

Forum Jump:


Users browsing this thread: 1 Guest(s)