fbpx

How to write conditional scripts

How to write conditional scripts

Home Forums Ask Expert How to write conditional scripts

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #31747
    Ganga mai
    Participant

      I am writing a test wherein the page might show a pop up or not depending on whether the cart is empty or not empty.
      So I need to check if a particular text (of the pop up) appears so that i can perform a click on the required button, something like this –
      If Application(“Demo”).View(“View 1”).Object(“Object 2”).Exists
      then Application(“Demo”).View(“View 1”).Object(“Object 2”).Object(“Obj3”).Click
      else
      with the next steps

      How can I do this? Please help.

      #31748
      Kirill Bulatnikov
      Participant

        Hello gangamai.k. Thanks for using ZAPTEST.

        Do you have pop up appearing on the different window or in the same page?
        If it still the same page then your if-else statement is ok and pretty straight forward. It is regular VB or JS syntax.
        But if pop up appears in the different window you need to specify it. Try to scan new window to the new applicatin in this case

        Thanks.
        ZAPTEST Team

      Viewing 2 posts - 1 through 2 (of 2 total)
      • You must be logged in to reply to this topic.

      Virtual Expert

      ZAPTEST

      ZAPTEST Logo