*** DEPRECATION WARNING *** You are calling a method named table. *** This method does not exist in page-object so it is being passed to the driver. *** This feature will be removed in the near future. *** Please change your code to call the correct page-object method. *** If you are using functionality that does not exist in page-object please request it be added.
You might see a warning similar to this one when you use the new page-object release. I am planning on removing something that current exists in the gem. This post will explain what and why.
When the page-object gem was young there was a significant amount of functionality that existed in the native drivers (watir-webdriver and selenium-webdriver) that was not exposed via the page-object gem. At that time I decided to override
method_missing in the
Element class to directly delegate all unknown calls to the underlying native element. This was a work around to make it easier for the users to use these capabilities while I was busy adding all necessary functionality into the page-object gem.
I will be removing this capability in about two months. At that time you will get an error when you call a method on an
Element that doesn’t exist. The warning message should provide guidance to you on what you will need to change over the next two months.
Some of you may wonder why I am removing this feature. While it seemed like a good idea at the time I added this capability, it has been the source of most of the support I have provided for users. Many have found it confusing having both page-object and Watir calls mixed together and many errors resulted. At this point, over three fourths of the problems I help people with are directly related to these calls being used together. In almost every case the solution is to only use the page-object elements and methods.
What should I do?
You should run your scripts and note where these warnings occur. When you see them you should adjust your code to use the page-object methods and objects. If you do find that there is some feature you need that is currently not supported by page-object please go to the issues page and open an issue. I will respond to it as soon as possible.