Forum Discussion

thustead's avatar
thustead
Contributor
13 years ago

If Object is visible do ... not working

In a key word test I am trying to use the "If Object" test action, so that if a pop up window is visible do some child operations, else do not, but the script errors out with the below error:



The 'Aliases.Client.wndWindowsForms10Window8app02e0c681.WindowsForms10MDICLIENTapp02e0c681.FormStart.panelView.SearchRfcView.tabControl.tabPageBasicSearch.searchViewBasic.WinClient_Panels_Admin_BasicRolesQueryPanel_searchResultsGrid.panelNoSearchResults.labelNoSearchResults' object does not exist



I don't know why the script stops with this error, it should just continue and not do the operations I tell it to do if the window exists.  Attached are screens shots of how I setup the If Object action.  I'm testing a C# application.



Anyone have any suggestions.



Thanks,

Tom

5 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    You cannot call the "Visible" property of an object that does not exist.  If the object of what you're doing is to test the existance of the object, use the "exists" property instead.
  • Hi Robert,



    I switched all my test actions to do "If Object Exists", most are working but there are a few that seem to ignore this statement and execute the child operations under the If statement even thoguth the pop-up does not exists.  I remember now this is why I switched to trying the "if visisble" method.  I may start a new thread in the forum for this specific issue.



    Thanks,

    Tom
  • Hi Tom,


    To help us reproduce the issue, please specify which test actions ignore the If Object operation and send us a screenshot of your keyword test.

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    If Object Exists may return a false positive if your mapping of the object in question is "ambiguous" enough that it is incorrectly detecting a different window as the window you are looking for.  Double check your mapping of the object in question and make sure that your criteria is sufficiently specific to distinguish it from other windows in your environment.
  • Thanks Robert and Margaret,



    I got past this issue in the script I was having this specific issue with, I don't remember exactly what I did to get around it, but I found another way to do what I wanted to do.  I think it was a mapping issue, our group is learning a lot more about this topic and we are trying to improve the way we map objects in our application, so that there are no conflicts.



    Tom