使用selenium webdriver等元素的属性来改变值

时间:2017-05-05 20:19:51

标签: python python-3.x selenium selenium-webdriver

我有一个属性为“aria-busy”的元素,当数据处于搜索和完成状态时,该元素从true变为false。我如何使用selenium Expected Conditions和Explicit Waits等待20秒的默认时间,如果达到20秒且属性未从true更改为false。抛出异常。我有跟随,但它没有真正起作用

public class TheRegistery :StructureMap.Registry
{
    public TheRegistery()
    {
        For<IMyInterface>().Use<YourClassName>();  // << This Syntax

        Scan(scanner =>
        {
            scanner.WithDefaultConventions();
            scanner.AssemblyContainingType<UserMailer>();
        });
    }
}

1 个答案:

答案 0 :(得分:1)

另一种方法是使用自定义定位器检查属性值,您不仅要检查id,还要检查aria-busy属性值:

self.wait.until(EC.presence_of_element_located((By.CSS_SELECTOR, "#xxx[aria-busy=false]")))
相关问题