Forum Discussion

googleid_118035's avatar
googleid_118035
Contributor
11 years ago

Please help me to over come this Error message : Object required : '[string: "Category"]'

My VB code as below;


Sub Test1()

Dim sysval


Set page1 = Sys.Browser("iexplore").Page("http://localhost/my_testapp/frmMytestpage.aspx")


Set sysval = page1....Table("ctl00_cphMainContent_rgGrid_ctl00_Header").Cell(0, i).innerText


Call Log.Message(sysval, "")


End Sub

--------------------------------

I am getting following error message for above line in bold.

Error message : Object required : '[string: "Category"]'



Error message attach here with.


  • Hi Dev,


     


    The innertText property returns a string. So, there is no need to use the Set statement to assign the sysval variable. Here is the corrected line:




    sysval = page1....Table("ctl00_cphMainContent_rgGrid_ctl00_Header").Cell(0, i).innerText



  • rgratis's avatar
    rgratis
    Frequent Contributor
    I think we would need the entire line to troubleshoot, as part of it seems to have been omitted.  That message most often comes up when you have a bunch of objects (object1.object2.object.3) and one of them is not recognized.
  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi Dev,


     


    The innertText property returns a string. So, there is no need to use the Set statement to assign the sysval variable. Here is the corrected line:




    sysval = page1....Table("ctl00_cphMainContent_rgGrid_ctl00_Header").Cell(0, i).innerText