Thread Rating:
  • 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Cannot find the "[ WebButton ]" object's parent "[ Page ]" (class Page)
#1
Solved: 10 Years, 9 Months ago
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).
Reply
#2
Solved: 10 Years, 9 Months ago
Please share the test data for which you are running the script.
Reply
#3
Solved: 10 Years, 9 Months ago
Here is test Data in Keyword.xls file. Click this link
https://docs.google.com/file/d/0ByyM9IuI...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"
Reply
#4
Solved: 10 Years, 9 Months ago
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.

Reply
#5
Solved: 10 Years, 9 Months ago
yes u need to have object repository associated with your action..thats why yor are getting this error...
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Handler Page Redirects zunebuggy 1 1,004 09-15-2020, 11:01 PM
Last Post: Ankur
  How to identify an error page occurring in server in between the qtp run. aswini 1 1,639 05-04-2017, 03:52 PM
Last Post: Ankur
  click each web link in a page using Index or other method in QTP smeijer 13 23,673 04-29-2017, 04:53 PM
Last Post: kowshik
  How to get the links which appears on mouse hover of parent link rajendra649 9 34,836 03-10-2017, 06:35 PM
Last Post: satish00k
  Page element keep changing chong67 4 4,278 11-08-2016, 09:17 PM
Last Post: Paul Rammone

Forum Jump:


Users browsing this thread: 1 Guest(s)