Object not visible error?
Hi all, I have a function that can highlight and bring the browser window to the front, but every time I runs it the test result will show failed and states that the object is not visible, while the browser did brought to the front and the Test were not interrupted. Any idea how to work around it, like make the failed message ignored for particular function?
Below is the code I used:
hWnd = Object.GetROProperty("hwnd")
On Error Resume Next
Window("hwnd:=" & hWnd).Activate
If Err.Number <> 0 Then
Window("hwnd:=" & Browser("hwnd:=" & hWnd).Object.hWnd).Activate
On Error Goto 0
That is because you can only activate a top level window. The hwnd you provide is of page inside the browser and not of the main window. See the link for solution Difference between IE6 and IE7 | KnowledgeInbox