-
Notifications
You must be signed in to change notification settings - Fork 219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to make page-object use Selenium driver instead of Watir #481
Comments
Hi @mahula, That is documented here - https://github.com/cheezy/page-object#creating-your-page-object If you're using the Hope this helps. |
Hi @kapoorlakshya, thank you for the quick response. I initialize my page objects the way gprovided in the doc you mention https://github.com/cheezy/page-object#creating-your-page-object:
But still, when running a test where the driver cannot locate an element of the declared page objects, the failure information is about Watir timie out caused by Watir trying to find the element:
And at initialization the module PageObject seems to use Watir anyway: Is there a way to use page-object only with a Selenium Webdriver? |
@mahula , is there a reason you want to purely use Selenium? As of version 2 of Page-Object, Watir is used under the covers - regardless of whether you initialize the page-object with a Selenium::WebDriver or a Watir::Browser. This was done to remove a lot of code duplication in the framework. There was an attempt to make it transparent from the user's perspective - ie that the user could still write their page object methods in Selenium API. However, I think we need some improvements there. |
Hi @jkotests, thank you for the response. The tool combination of Selenium and RSpec works fine for my web application testing purposes. Selenium (in Java) implements the page object modelling approach. So - thanks to @cheezy and everyone else contributing to this project - the page-object library can be utilized in that context, which is great. |
The reason 2.0 uses watir is because it was essentially already implementing a lot of the same functionality, but in a way that wasn't as comprehensive and wasn't able to take advantage of many key features found in watir 6. Watir uses selenium, while attempting to add additional test logic to optimize testing reliability. If you use the page object API the way cheezy intended it should handle all of the wrapping for you without the implementation itself mattering to you. One of the disadvantages of using an opinionated DSL is that you don't always have the flexibility to work around it. If there's something in particular you are trying to accomplish, we can show you the right way to do it in the page object gem. |
How exactly do I make page-object use a Selenium webdriver when initializing it?
The text was updated successfully, but these errors were encountered: