Forum Discussion

jawed's avatar
jawed
Occasional Contributor
7 years ago

How to check visibility or existence and close of unusual screen when running keyword script

I have recorded script, uses data driven loop to provide data from CSV, with first loop it work fine but in second loop web application display unusual screen because of this recorded element is not visible. so  i want to close that window using if condition as it is not visible all time. Pls help me to achieve this.

  • jawed's avatar
    jawed
    7 years ago

    Thanks for ur instance reply I want to share what i have done . I uses if object Test action and check existence of popup by selecting exists option. and put recorded script for closing that popup in if object block. It work for me.

     

  • baxatob's avatar
    baxatob
    Community Hero

    You can map your "unusual screen" into the NameMapping repository and check its existence in the beginning of the loop:

     

    if Aliases.UnusualScreen.Exists:
      closeUnusualScreen()

    or simply use Find() for some property/value pair, which is relevant to your unexpected window:

     

    if Find(Property, Value, Depth).Exists:
      closeUnusualScreen()
  • FYI:  I don't want to take credit for this solution but another user suggested the use of the WaitAliasChild method when checking/waiting for an object's existence - sometimes it works better than the exists or wait method.  For my issue - it did work better.

    • jawed's avatar
      jawed
      Occasional Contributor

      Thanks for ur instance reply I want to share what i have done . I uses if object Test action and check existence of popup by selecting exists option. and put recorded script for closing that popup in if object block. It work for me.