1
在Selenium中使用PageObject模式,我想将所有定位器放在资源文件中。FindsBy属性与资源文件c#Selenium
尽可能使用与资源文件FindsBy属性
[FindsBy(How = How.Id, Using = "btnUserApply")]
public Button ApplyButton { get; set; }
变得低于疑惑给出了一个错误和不能做
[FindsBy(How = How.Id, Using = MyRexFile.btnUserApply)]
public Button ApplyButton { get; set; }
FindsBy也是密封的,不能继承。
有什么建议吗?
你说只与常量的作品?关于如何创建自己的定制FindsBy来接受属性。关于这个 – developer9969
@ developer9969没有太多东西可以,“FindsBy”只能用于常量。我从来没有尝试过创建自定义的'FindsBy',也没有遇到这种尝试。但也许这是可能的。 – Guy