SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 7 of 7
  1. #1
    Member
    Join Date
    May 2004
    Location
    UK
    Posts
    47
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Problem with RegisterUserFunc

    I am using the RegisterUserFunc and registered my function to work for Select (WebList)

    When I am using the following code, its working fine
    Set objChild = Browser("B").Page("P").Frame("F").WebList("A")
    objChild.Select "Test"

    But when I am using the

    Browser("B").Page("P").Frame("F").WebList("A").Sel ect ("Test")

    Itís given the error
    Error # 424, Object Required

    Please help me on the same, and let me know, if any one need any more details.
    Sanjay

  2. #2
    Moderator
    Join Date
    Sep 2001
    Location
    Doncaster, UK
    Posts
    5,788
    Post Thanks / Like
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Problem with RegisterUserFunc

    Browser("B").Page("P").Frame("F").WebList("A").Sel ect "Test"

    Mark Smith.

  3. #3
    Moderator
    Join Date
    Jul 2005
    Location
    Delhi
    Posts
    15,575
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    7 Thread(s)
    Total Downloaded
    0

    Re: Problem with RegisterUserFunc

    What you are trying to do will work with a call statement

    Call Browser("B").Page("P").Frame("F").WebList("A").Sel ect ("Test")

  4. #4
    Member
    Join Date
    May 2004
    Location
    UK
    Posts
    47
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Problem with RegisterUserFunc

    I already try both statements

    i.e.
    Browser("B").Page("P").Frame("F").WebList("A").Sel ect "Test"

    And

    Call Browser("B").Page("P").Frame("F").WebList("A").Sel ect ("Test")

    But in the both cases QTP is not performing any thing and it will stop the execution.

    I am using MsgBox ("Error # " & CStr(Err.Number) & " " & Err.Description & " " & Err.Source) to get the error description

    i.e. Error # 424 Object Required Microsoft VBScript Runtime error

    I think there is some problem with my QTP (8.2)Ö.
    Sanjay

  5. #5
    Moderator
    Join Date
    Jul 2005
    Location
    Delhi
    Posts
    15,575
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    7 Thread(s)
    Total Downloaded
    0

    Re: Problem with RegisterUserFunc

    I am using the RegisterUserFunc and registered my function to work for Select (WebList)


    Post the function that you are using?

  6. #6
    Member
    Join Date
    May 2004
    Location
    UK
    Posts
    47
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Problem with RegisterUserFunc

    Find the function below

    Function fnSelect(objTestObject, strValue)
    Dim strName
    Dim strClassName
    Dim strType
    Dim strAllItems

    '------------------------------Set the return Value-----------------------------------
    fnSelect=False

    '-------------------------------Verify the object---------------------------
    If (objChild is Nothing) Then
    fnInsertResult "Object Idetification", "Verifying the Object Idetification", "Please verify the Object Property", "FAIL"
    Exit Function
    End If

    strName=objTestObject.GetROProperty("Name")
    strClassName=objTestObject.GetROProperty("micClass ")
    strType=objTestObject.GetROProperty("Html Tag")

    '------------------------------Verify the object exist------------------------------------------------
    If Not (objTestObject.Exist(0)) Then
    Call fnInsertResult ("Object Idetification", "Verifying the Object Idetification", "Cannot identify the object Name: " & strName & " (of class " & strClassName _
    & " ) of Type: " & strType & ". Verify that this object's properties match an object currently displayed in your application.", "FAIL")
    Exit Function
    End If

    '-----------------------------If the object is Radio button or Dropdown box then check for the existance of value to be selected-------------------
    If ((strClassName = "WebList") Or (strClassName = "WebRadioGroup")) Then
    strAllItems=objTestObject.GetROProperty("all items")

    If instr(1, strAllItems, strValue, 1)=0 Then
    Call fnInsertResult ("Object Idetification", "Verifying Selection", "Cannot select '" & strValue & "' for the object Name: " & strName & " (of class " & strClassName _
    & " ) of Type: " & strType & ". Verify that this Selection value exists. Available Selections are - " & strAllItems, "FAIL")
    Exit Function
    End If
    End If

    '-------------------------------Verify the object is not disable -------------------------------------
    If Not ((objTestObject.GetROProperty("disabled"))=0) Then
    Call fnInsertResult ("Object Idetification", "Verifying the Object Idetification", "Object Name: " & strName & " (of class " & strClassName & " ) of type " & strType _
    & " is disabled.", "FAIL")
    Exit Function
    End If

    fnSelect=objTestObject.Select (strValue)

    End Function


    Its working fine, if i am creating the object and calling the function but not with normal code
    Sanjay

  7. #7
    Moderator
    Join Date
    Jul 2005
    Location
    Delhi
    Posts
    15,575
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    7 Thread(s)
    Total Downloaded
    0

    Re: Problem with RegisterUserFunc

    Where is objChild object coming from? I dont see it anywhere

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 12.50%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 01:37 AM.

Copyright BetaSoft Inc.