Micro Focus QTP (UFT) Forums
QTP not able to identify my Browser, has anybody experienced this issue? - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: QTP not able to identify my Browser, has anybody experienced this issue? (/Thread-QTP-not-able-to-identify-my-Browser-has-anybody-experienced-this-issue)



QTP not able to identify my Browser, has anybody experienced this issue? - lotos - 08-05-2010

Hi All,
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



RE: QTP not able to identify my Browser, please help - it is very URGENTLY - Saket - 08-05-2010

I think the name is causing the issue here
obj_WebBrowser ("name").value = "Microsoft Internet Explorer"

keep it as ".* Microsoft Internet Explorer", should solve your issue.

I always noticed that if you put anything like 'Urgent', 'ASAP' etc, you will never get a reply Smile. That means, it seems members here does not like these words . read posting guidelines.


RE: QTP not able to identify my Browser, please help - it is very URGENTLY - lotos - 08-05-2010

Hello Saket,
thanks a lot, but I tried a lot of type of descriptions for objects, for e.g. I used next:

Code:
Set obj_WebBrowser = Description.Create  
    obj_WebBrowser ("micclass").value = "Browser"
    obj_WebBrowser ("LocationURL").value = URL & ".*"
    obj_WebBrowser ("openurl").value= URL & ".*"
but it's still doesn't work.. when I found this issue by now passed 4 days, and I've read a lot of forums and there is no answer..
Also in some tests this issue doesn't appears, but in ~90% of tests it's appears..

about the:
Quote:I always noticed that if you put anything like 'Urgent', 'ASAP' etc, you will never get a reply Smile. That means, it seems members here does not like these words . read posting guidelines.
also Thanks!


RE: QTP not able to identify my Browser, has anybody experienced this issue? - Saket - 08-05-2010

try to add "Creationtime" description as well, see if that helps


RE: QTP not able to identify my Browser, has anybody experienced this issue? - venkatbatchu - 08-05-2010

Also u could go with "HWND property" it would useful try with this

Venkat.Batchu


RE: QTP not able to identify my Browser, has anybody experienced this issue? - rkkumar - 03-07-2012

I see you have special characters in your openurl.Try replacing those with character codes/regular expression.


RE: QTP not able to identify my Browser, has anybody experienced this issue? - sshukla12 - 03-12-2012

Hi,
Don't go for so much properties to create a description, u can use

Dim URL: URL = "http://wasce.wasce.st/RBSIFCSM/"

Code:
Set obj_WebBrowser = Description.Create

Code:
obj_WebBrowser ("micclass").value = "Browser"
' Use the regular expression as the name displayed on your page what I 'had used is an exapmle.
    obj_WebBrowser ("name").value = "Microsoft Internet Explorer.*"


Code:
Set obj_WebPage = Description.Create  
    obj_WebPage ("micclass").value = "Page"

Set EnvironmentURL = Browser(obj_WebBrowser).Page(obj_WebPage)


Regards,
Sankalp