Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Object not found when creating an object during runtime
#3
Not Solved
Hi Tarik!

Actually, the txtSearchField description for the JavaEdit text box is found in several forms (all of them are search forms), meaning, that this particular text box will differ in its attached text and its developer name for each form. So, I don't think I can add any more specific properties. Although I did find some sort of workaround though:

Code:
            Set txtSearchField = Description.Create()
                txtSearchField("Class Name").Value = "JavaEdit"
            Set objSearchField = objWindow.ChildObjects(txtSearchField)

            strAttachedText = objSearchField(0).GetROProperty("attached text")
            strDeveloperName = objSearchField(0).GetROProperty("developer name")

            ' Input the value into the search field
            If strDeveloperName <> "" Then
                objWindow.JavaEdit("developer name:=" & strDeveloperName).Set valReqdObj
            ElseIf strAttachedText <> "" Then
                objWindow.JavaEdit("attached text:=" & strAttachedText).Set valReqdObj
            End If

Also, when I tried doing your suggestion, I encountered an "Unspecified error" runtime error:

Code:
            Set txtSearchField = Description.Create()
                txtSearchField("Class Name").Value = "JavaEdit"
            Set objSearchField = objWindow.ChildObjects(txtSearchField)

            strAttachedText = objSearchField(0).GetROProperty("attached text")
            strDeveloperName = objSearchField(0).GetROProperty("developer name")

            ' Input the value into the search field
            If strDeveloperName <> "" Then
                objWindow.objSearchField(txtSearchField).Set valReqdObj
            ElseIf strAttachedText <> "" Then
                objWindow.JavaEdit("attached text:=" & strAttachedText).Set valReqdObj
            End If
Reply


Messages In This Thread
RE: Object not found when creating an object during runtime - by riechan - 07-24-2012, 07:30 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Object not found during the 2nd iteration of an Action call in a For loop BGunay 0 969 04-23-2020, 07:08 PM
Last Post: BGunay
  Collecting Objects And Object State At Runtime zunebuggy 3 1,719 11-22-2017, 02:37 PM
Last Post: supputuri
  object spy not recognizing object.. pleaseeeee help Sonia Sadeque 3 3,439 12-22-2016, 02:42 PM
Last Post: ishan.mahajan@adp.com
  When trying to recognize the object in QTP, each object is recognized as “WinObject:S geetasarvadnya 2 3,764 10-28-2015, 12:34 PM
Last Post: vinod123
  Object repository losing object properties ishan.mahajan@adp.com 2 3,760 08-20-2015, 11:33 PM
Last Post: ADITI1992

Forum Jump:


Users browsing this thread: 1 Guest(s)