webdriver wait for one of a multiple elements to appear

后端 未结 2 1159
醉梦人生
醉梦人生 2021-02-14 16:17

Is there a way to get a webDriverWait to wait for one of a number of elements to appear and to act accordingly based on which element appears?

At the moment

2条回答
  •  心在旅途
    2021-02-14 16:46

    Something like that:

    def wait_for_one(self, xpath0, xpath1):
        self.waitForElement("%s|%s" % (xpath0, xpath1))
        return int(self.selenium.is_element_present(xpath1))
    

提交回复
热议问题