Search code examples
xpathrobotframeworkelementwaitkeyword

Is it possible to wait for two Web Elements at the same time in Robot Framework via Xpath?


I have two Web Elements and if one of them appears it should trigger a keyword. But i dont find anything in the web to connect a logical operation like OR/AND into my XPATH... Is there a possible workaround??

Wait Until Element Is Visible ||| //body/div[@id='app']/div[${count1}]/div[${count2+2}

but the trigger shoud be ${count2+2} OR ${count2+1}


Solution

  • Before anything else: this is not a question of Robot Framework but on how to work with xpath and identify elements in the page.

    So if you want to search 1 div or another div, just find the "thing" that clearly identify each and then:

    //div[@this='first' or @that='second']
    

    If the elements are in different nodes/levels, you can always do:

    (//div[@this='first']) | (//div[@that='second'])