Micro Focus QTP (UFT) Forums
Unable to identify WebEdit Obj - 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: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: Unable to identify WebEdit Obj (/Thread-Unable-to-identify-WebEdit-Obj)



Unable to identify WebEdit Obj - drewTP1 - 01-12-2010

Hi Everyone. I am getting the following error: "Cannot identify the object "[ WebEdit ]" (of class WebEdit). Verify that this object's properties match an object currently displayed in your application."

This code works perfectly fine EXCEPT when webeditname = some value with parenthesis in them. For Ex: Key_Name_(Last)_1
This code is able to identify that the object's name exists in the spreadsheet (1st row), in this case Key_Name_(Last)_1, however, when it enters the IF statement and tries to .Set the value taken from the spreadsheet (2nd row) I get the error. Any ideas??


The piece of code I'm having trouble with is below:

Code:
For i = startpoint To co.Count-1
  If LCase(Trim(co(i).GetROProperty("micclass"))) = LCase(Trim("webedit")) And LCase(Trim(co(i).GetROProperty("type"))) = LCase(Trim("text")) Then
        For n = 1 To totalcol
            If  LCase(Trim(co(i).GetROProperty("name"))) = LCase(Trim(spsh.Worksheets(1).Cells(1, n).Value)) Then
                webeditname = spsh.Worksheets(1).Cells(1, n).Value
                Trim(webeditname)
                webeditname = Trim(webeditname)
                webeditvalue = spsh.Worksheets(1).Cells(2, n).Value
                
                'MsgBox webeditname
                'MsgBox webeditvalue
                Window("APP").Window("eForm").Page("title:=" & pagename).WebEdit("name:=" & webeditname).Set  webeditvalue
                Exit For
            End If  
        Next
    End If

please disregard the two lines as i was trying different solutions and forgot to edit them out. thanks.

Trim(webeditname)
webeditname = Trim(webeditname)


RE: Unable to identify WebEdit Obj - satan - 01-13-2010

hi..
try "Key_Name_\(Last\)_1" as webedit name in ur data sheet


RE: Unable to identify WebEdit Obj - drewTP1 - 01-13-2010

worked perfectly! thanks!