Forum Discussion

james_s_bullen's avatar
james_s_bullen
Occasional Contributor
12 years ago

Run loop until item is no longer visible

I am attempting to test a web application that shows a void button on one page, I don't know how many times this void button will be listed at any given time.



Is there a way to create a loop that clicks this button and performs an action until there are no more void buttons left to be clicked on?



I use the Keyword Test method personally as my coding skills aren't very good.



Thank you for any help in advance. 

4 Replies

  • Marsha_R's avatar
    Marsha_R
    Icon for Champion Level 3 rankChampion Level 3
    If you're just waiting for the button to go away, it will be something like



    While (Voidbutton.Exists equals True)

        Delay  









  • james_s_bullen's avatar
    james_s_bullen
    Occasional Contributor
    The button is listed numerous times for example



    VOID

    VOID

    VOID

    VOID



    As each is clicked and closed it becomes less and less until they are all gone. Basically I want to automate that action using Keyword Tests, I have no idea about the coding part of it.



    I also don't see anything called "While" there is a for loop and while loop?
  • james_s_bullen's avatar
    james_s_bullen
    Occasional Contributor
    I found a way to do it.



    If .. then Value1 = void button Equals Value 2 = void button

    Label

    Button pressing stuff here

    Go to Label

    Else

    Do something else



  • jose_pita's avatar
    jose_pita
    Super Contributor
    you should ident the action after the if, otherwise the if is not doing anything there..



    anyway, on the statments operation (left toolbox panel) you have the while action