Integrate PageFactory with PageObjectModel in appium | @AndroidFindBy | @iOSXCUITFindBy
HTML-код
- Опубликовано: 23 июл 2020
- Complete tutorial - bit.ly/qav_appiumtutorial
This video will explain how to integrate PageFactory with PageObjectModel in appium framework and also know how to keep the single code base to run the appium tests in both Android & iOS.
Sometimes Android & iOS apps behave bit differently based on the native build controls, so we will see how we can automate those rare scenarios based on the platform android or ios.
You will see the use of @AndroidFindBy & @iOSXCUITFindBy annotations to locate the elements for both Android & iOS, so single webElement can be used for both Android & iOS.
Code base - github.com/sunilpatro1985/App...
Really Good and informative Video! Good Luck !
the last words in the video is not usually mentioned in tutorials, but it's true.
Thanks for uploading this video. Found it very informative. Here I see that the input text "qavbox" that you passed is static text..How to handle a text that we are getting in runtime?
I passed the input text as variable yo the xpath, not static text. it's passed dynamically at run time.. if you still have question, then post the line of code here..
@@qavboxhi.. the code I am talking about is in client machine so I am not able to post it here. But the scenario is like this..suppose, I have a transaction number which generates in runtime. This number is unique and changes everytime. Now if I have to use this number as an input for some other field during automation itself. How can I do that.
Hope I am not confusing you more :)
Thanks. Need help how to implement same concept in cucumber framework?
Sure, what's the question?
@androidfindby and @iosxcuitestfindby supported in appium 2.0 and java client 8 above?
AndroidFindBy and iOSXCUITFindBy are applicable for appium 2.0
Hi @qavbox
I'm getting java.lang.ExceptionInInitializerError while initElements
PageFactory.initElements(new AppiumFieldDecorator(driver), this);
Do you have any idea why it is throwing ExceptionInInitializerError?
your response is appreciated
Hello, this issue might be you are using AndroidDriver/IosDriver instead of AppiumDriver type inside pagefactory.initelement()
Hi, thanks for the video. I tried using this method (@AndroidFindBy and @iOSXCUITFindBy) but I keep getting NullPointerException every time I use it.
Can you pls help? Appium version - 8.1.1
Thanks
Hello. Did you initialise pagefactory elements with driver object before Appiim By locators?