Forum Discussion

pbruneau's avatar
pbruneau
New Contributor
9 years ago

How do I validate if a an action redirected to a specific page

I have a button on a page that can redirect to any one of two pages. How can I setup an if else based on which page it redirects to. Note, I am trying to do this with a keyword test if possible. If not, I'll be force to use a script.

  • Thanks, I ended up using a different method. I created a script function where I pass in a page name and it will return true or false if the current page url contains that name.

  • NisHera's avatar
    NisHera
    Valued Contributor

    choose a unique object or property in either of page 

    check whether that object /property exists.

     

    you can use object spy to look at object /property of page/s  

    if object you can use object.exists method something like ............

           if page.object.exist then page A else page B 

     

    if property simply check it something like..

             if page.property == A then page A

             if page.property == B then page B

     

    • pbruneau's avatar
      pbruneau
      New Contributor

      Thanks, I ended up using a different method. I created a script function where I pass in a page name and it will return true or false if the current page url contains that name.