cant interact with elements when using @FindBy page object model annotation
driver.findElement(By.xpath(str)).click //works but... @FindBy(xpath = str) public WebElement btn;
public void method() { btn.click(); // this does not work }
Would be good if we had an @MacFindBy annotation like the one for windows @WindowsFindBy
I'm trying to test an App at work that is on both Mac and Windows.
Originally I used Squish (commercial tool) to test on Mac (as it was developed in C# and not native Cocoa app) and then C# CodedUI for Windows version.
CodedUI is being deprecated and Microsoft etc recommend using Appium with WinAppDriver. It would be absolutely amazing if I could use Page Objects Model for Mac tool as well and just use one framework for both platforms :D
@chronicideas :- do you get any solution for this?
Have not heard anything around this. But Simon Stewart, the lead on Selenium recommends AGAINST using PageFactory. More recently I have learnt that @FindBy elements don't follow YAGNI principles (you ain't gona need it). Really we should make our own page objects and elements and only init them when we need to use them. So that itself might be a solution for this. I'm sure others would still appreciate support with PageFactory though.
Anything new to this? Looking for answer too :-)