08-05-2010, 02:57 PM
(This post was last modified: 11-15-2017, 10:44 PM by lotos.
Edit Reason: hide real url
)
Hi All,
when I am running the test I am getting the following error:
I am using it's calls in next way:
And it is called in a class' function like this:
And now the class is called like this:
when I am running the test I am getting the following error:
Quote:Cannot identify the object "[ Browser ]" (of class Browser). Verify that this object's properties match an object currently displayed in your application.Can anybody let me know how can I resolve this problem.
I am using it's calls in next way:
Code:
Dim URL: URL = "http://theURL.com"
Set obj_WebBrowser = Description.Create
obj_WebBrowser ("micclass").value = "Browser"
obj_WebBrowser ("name").value = "Microsoft Internet Explorer"
obj_WebBrowser ("application version").value="internet explorer 6"
obj_WebBrowser ("LocationURL").value = URL & ".*"
obj_WebBrowser ("openurl").value= URL & ".*"
Set obj_WebPage = Description.Create
obj_WebPage ("micclass").value = "Page"
Set EnvironmentURL = Browser(obj_WebBrowser).Page(obj_WebPage)
And it is called in a class' function like this:
Code:
Public Function TextBox
Set TextBox = New QTPTextBox
End Function
Class QTPTextBox
'texfield identified by name
Public Function SetTextByName (elementName, elementValue)
Set obj_WebEdit = Description.Create
obj_WebEdit ("micclass").value = "WebEdit"
obj_WebEdit ("name").value= elementName
With Browser(obj_WebBrowser).Page(obj_WebPage)
'also there can be used like this: "With EnvironmentURL.... End With"
.Sync
.WebEdit(obj_WebEdit).Set elementValue
End with
End Function
End Class
And now the class is called like this:
Code:
With TextBox
' set username
.SetTextByName "j_username", User
' set password
.SetTextSecure "j_password", Password
End With