Micro Focus QTP (UFT) Forums
Cannot find the "[ WebButton ]" object's parent "[ Page ]" (class Page) - 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: Cannot find the "[ WebButton ]" object's parent "[ Page ]" (class Page) (/Thread-Cannot-find-the-WebButton-object-s-parent-Page-class-Page)



Cannot find the "[ WebButton ]" object's parent "[ Page ]" (class Page) - sumitparolkar@gmail.com - 04-28-2013

I am beginner and trying keyword driven framework.. here is my script for login to Gmail account.
Code:
******initiate variable****
ExecuteFile "F:\Scripts\Login\Constant\OR Constants.vbs"
Systemutil.Run "www.gmail.com"
'**************Add a new sheet and import keywords**********
Set dtKeyWord = DataTable.AddSheet("Keywords")
DataTable.ImportSheet "F:\Scripts\Login\KeyWords\ScriptKeywords.xls","sheet1","Keywords"
dtRowCount = dtKeyWord.GetRowCount
msgbox(dtRowCount)
dtColumnCount = dtKeyWord.GetParameterCount
msgbox(dtColumnCount)
'Use for loop to get values row by row
For dtRow=1 to dtRowCount
           dtKeyWord.SetCurrentRow(dtRow)
                 strObjClass  =               DataTable("ObjectClass","Keywords")
                 strObjProperties = DataTable("ObjectProperties","Keywords")
                 strOperation =               DataTable("Operation","Keywords")
                 strValue =                       DataTable("Value","Keywords")
If strOperation = "SetParent" Then
                oParentObjectArray = Split(strObjClass, "/")
                oParentObjectPropArray  = Split(strObjProperties, "/")
                For iparentCount = 0 to ubound(oParentObjectArray)
                        iParent = oParentObjectArray(iparentCount)
                        msgbox(iParent)
                        iParentProp = oParentObjectPropArray(iparentCount)
                        msgbox(iParentProps)
                      If  iparentCount = ubound(oParentObjectArray)  Then
                          strParent =  strParent&iParent&"("&""""&eval(iParentProp)&""""&")"
                          msgbox(strParent)
                          Exit for
                      End If
                         strParent =  strParent&iParent&"("&""""&eval(iParentProp)&""""&")."
                         msgbox(strParent)
                Next
      ParentObject = strParent
      msgbox(ParentObject)
  Else
       oStatement =  ParentObject&"."& strObjClass &"("&""""&eval(strObjProperties)&""""&")."& strOperation
       msgbox(oStatement)
       If strValue<>"" Then
             oStatement = oStatement& """"&strValue&""""
             msgbox(oStatement)
             else
             oStatement = oStatement
             msgbox(oStatement)
       End If
           msgbox(oStatement)
        Execute(oStatement)
End If
Next

Can any one help me on this I am facing these error:
Cannot find the "[ WebButton ]" object's parent "[ Page ]" (class Page).
Cannot find the "[ WebEdit ]" object's parent "[ Page ]" (class Page).



RE: Cannot find the "[ WebButton ]" object's parent "[ Page ]" (class Page) - Ankesh - 04-30-2013

Please share the test data for which you are running the script.


RE: Cannot find the "[ WebButton ]" object's parent "[ Page ]" (class Page) - sumitparolkar@gmail.com - 04-30-2013

Here is test Data in Keyword.xls file. Click this link
https://docs.google.com/file/d/0ByyM9IuIxEnLa1Z0UUNrdjU2Zjg/edit?pli=1

Declaration in OR constant.vbs ::
Public Const GoogleBrowser = "name:=Gmail: Email from Google"
Public Const GooglePage = "name:=Gmail: Email from Google"
Public Const EmailWebEdit = "name:=Email"
Public Const PwWebEdit = "name:=Passwd"
Public Const LoginWebButton = "name:=signIn"


RE: Cannot find the "[ WebButton ]" object's parent "[ Page ]" (class Page) - Saket - 05-02-2013

what about Object repository, is it being associated runtime or associted already?
in any case make sure your object repository is associated and the object you want to work with, is available there in appropriate hierarchy.


RE: Cannot find the "[ WebButton ]" object's parent "[ Page ]" (class Page) - agarwl.anurag - 05-03-2013

yes u need to have object repository associated with your action..thats why yor are getting this error...