Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Error while adding Object to Object repository at run time
#1
Solved: 10 Years, 8 Months, 1 Week ago
Hi All,

I am trying to add new object to object repository in run time with the following code resulting "error : R6025 -pure virtual function call" please help me on this.

Code:
Set RepositoryFrom  = CreateObject("Mercury.ObjectRepositoryUtil")
RepositoryFrom.Load  "c:\testrep.tsr"
Set PageObj = RepositoryFrom.GetObjectByParent("Browser(""Google"")","Page(""Google"")")
Set CustomObj = Browser("Google").Page("Google").WebButton("micclass:=WebButton")
RepositoryFrom.AddObject CustomObj, PageObj
RepositoryFrom.Save
Set RepositoryFrom = Nothing

Regards,
SaranKumarV
Reply
#2
Solved: 10 Years, 8 Months, 1 Week ago
I guess you are running this code in QTP, remove the below statement from your script and put it in a vbs file. attach the vbs with your test. an try.
Code:
Set RepositoryFrom = CreateObject("Mercury.ObjectRepositoryUtil")

Reply
#3
Solved: 10 Years, 8 Months, 1 Week ago
Make sure you release the "PageObj" object as well!

Code:
Set PageObj = Nothing

This should fix the error.
Reply
#4
Solved: 10 Years, 8 Months, 1 Week ago
Can we also Rename Object's Logical name at the Runtime?
I tried with the following code :
Code:
Set mR = CreateOBject("Mercury.ObjectRepositoryUtil")
    mR.Load "C:\Users\Documents\ObjectRepository.bdb"
    mR.RenameObject Browser("TEstFolder").Page("abc"),"def"

I have tried to save it in the VBS file and then attached to the Test
But I am getting Error as : Object Can not be Renamed

I have also attached the Screenshot of the error


Attached Files Image(s)
   
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  adding atachment to QC (ALM) - overwrite psova 1 4,293 02-07-2023, 03:18 PM
Last Post: RachapudiSaiSowmya
  Error in Code while accessing WPF object Dinesh_cts 1 3,163 11-08-2017, 11:46 PM
Last Post: lotos
  Loading QRS files at Run time dvkbabu 2 9,808 03-24-2017, 09:04 PM
Last Post: UrmilaSaha
  Missing Resources, Information Pane, Debug Viewer, Run time Data Table not visible Aurodeepta 3 6,750 05-28-2015, 02:52 PM
Last Post: Aurodeepta
  Object Identification not working on Run Time Ajatshatru 2 3,085 05-06-2015, 07:27 PM
Last Post: Ajatshatru

Forum Jump:


Users browsing this thread: 1 Guest(s)