Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
300 views
in Technique[技术] by (71.8m points)

Robotframework : Repeat several keyword (written in Gerkhin) for pagination test

On my website, I verify several data on the first page (each verification corresponding to a keyword) :

I would like to repeat each keyword as many time as the pagination exists. I think that I must use FOR loop but I don't know how to do this.

Here is an example : The goal of this test is to verify that the pages display all advert which are SALE type and MARSEILLE city. For the first page, I create 2 keywords.

  • The page only displays a SALE advert

    ${elements}=  Get WebElements    id=type
    FOR  ${element}  IN  @{elements}
    Log  ${element.text}
    Element Should Contain    ${element}    VENTE
    END
    
  • The page only displays the MARSEILLE city

    ${elements}=  Get WebElements    id=locality
    FOR  ${element}  IN  @{elements}
    Log  ${element.text}
    Element Should Contain    ${element}    MARSEILLE
    END
    

I would repeat this keyword while the pagination exists.

Have you any idea? I'm a beginner on RF and I'm not a developer so if you have a "simple" solution, I take it :-)

question from:https://stackoverflow.com/questions/65934433/robotframework-repeat-several-keyword-written-in-gerkhin-for-pagination-test

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...