Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using QTP Automation Object Model to declare object classes
#1
Not Solved
[/u][/b]Hi,

I want to reduce the overhead of declaring objects such as write a 3-line decsription to declare WebEdit before I can use it. I am working on creating a dll in vb.net to do the declarations. Any user can simply refernce this dll in QTP and use the declarations present to simplify the qtp code. However, I cannot get this to work. Any idea on how to do this in vb.net. I created the following file but it is not working in QTP.

VB.net:[b]

Code:
Public Class Class1
    Public Function QTPHelper_Example()
        Dim qtApp As QuickTest.Application
        Dim qtIdent As QuickTest.ObjectIdentification
        Dim qtWebEdit As QuickTest.TestObjectClassIdentification

        qtApp = CreateObject("QuickTest.Application")
        qtIdent = qtApp.Options.ObjectIdentification

        qtWebEdit = qtIdent.Item("WebEdit")

        Return qtWebEdit

    End Function

End Class

[u][/b]QTP:[b][/u]

Set objDLL=DotNetFactory.CreateInstance("ClassLibrary6.Class1","C:\windows\system32\ClassLibrary6.dll")
Set objwebedit=objDLL.QTPHelper_Example()

objwebedit("html id").value = "cnnHeadsrchText"
Browser(browser).page(page).WebEdit(objwebedit).Set "test"
Set objDLL= Nothing
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  General Object Error(Find Object Error) akhandesh 1 3,595 02-24-2016, 01:05 PM
Last Post: sindhus
  If Object name is completely changing then I am unable to recognize that object swapna.9n9 0 2,119 11-14-2014, 05:35 PM
Last Post: swapna.9n9
  QTP highlights object incorrectly in INFOR EAM application akhandesh 0 2,198 01-24-2014, 12:22 PM
Last Post: akhandesh
  Clicking on Window object to make it a javaedit object indranilgoswamimcb 0 2,159 11-03-2013, 09:03 PM
Last Post: indranilgoswamimcb
  which gives better performance qtp with Object repository or qtp without OR. qtpexpert 6 6,544 10-29-2013, 08:56 PM
Last Post: Parke

Forum Jump:


Users browsing this thread: 1 Guest(s)