Note that there are some explanatory texts on larger screens.

plurals
  1. POQTP Link object does not support the Exist property
    primarykey
    data
    text
    <p>I have a weird problem with QTP 11. The following piece of code worked so far, but suddenly stopped working and throws Object does not support this property or method.: 'objPage.Link' for the line with 'if link exist'</p> <pre><code>Set objBrowser = Browser("creationtime:=" &amp; Desktop.ChildObjects(oDesc).Count - 1 &amp; "") Set objPage = objBrowser.Page("title:=.*") If objPage.Link("class:=menu_link_tab_.*", "html id:=.*DesktopTab").Exist(3) Then msgbox "ok" End If </code></pre> <p>Can anyone tell me what is wrong and/or how to do it right?</p> <p>EDIT: I solved this but still have no idea what happened. I just cut this part from QTP script and pasted it into Notepad and then copied it from Notepad to QTP. Everything works fine. I did not change anything... Any ideas what the hell happened are welcomed.</p> <p>ANOTHER EDIT: The problem reappears randomly. With no changes to anything I can just run the test 10 times to have it fail randomly with the 'Object does not support this property or method' message</p> <p>I have a startBrowser function where I set the objPage and objBrowser :</p> <pre><code>Function startBrowser(vURL) Dim oDesc Set IE = CreateObject("InternetExplorer.Application") IE.Visible = True IE.Navigate vURL Window("hwnd:=" &amp; IE.HWND).Maximize Set oDesc = Description.Create oDesc( "micclass" ).Value = "Browser" If Desktop.ChildObjects(oDesc).Count &gt; 0 Then Set objBrowser = Browser("creationtime:=" &amp; Desktop.ChildObjects(oDesc).Count - 1 &amp; "") End If Set objPage = objBrowser.Page("title:=.*") End Function </code></pre> <p>I have added lots of msgboxes with GetROProperty to verify whether the objects are ok. They seem to be.</p> <p>Now my function to click the link looks like this :</p> <pre><code>Function clickMainMenuLink(vIdentifier) Set objLink = objPage.Link("class:=menu_link_tab_.*", "html id:=.*" &amp; vIdentifier, "index:=0") If objLink.Exist(timeOut) Then objLink.Click Else reporter.ReportEvent micFail, "Click the " &amp; vIdentifier &amp; " menu link", "Cannot find the " &amp; vIdentifier &amp; " menu link" ExitTestIteration End If End Function </code></pre> <p>So at the moment my test just opens the browser and clicks a link as I try to debug the thing, but it still fails or passes randomly. The run error indicates line with 'Set objLink'. Any ideas for further debugging? I'm on QTP11 and IE8 if it matters.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload