-
Notifications
You must be signed in to change notification settings - Fork 57
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
Page objects with extended Selenium2Library #7
Comments
Sure, I could consider adding a configuration option to let you define
which selenium library to choose from, though I'm not convinced it's
necessary. You can just create your own base class that inherits from
PageObject, but redefines the se2lib property to be whatever you want.
…On Wed, May 10, 2017 at 7:42 AM, gaurav517 ***@***.***> wrote:
You use following to share instance of selenium2library:
BuiltIn().get_library_instance("Selenium2Library")
Now in my case, I extend Selenium2Library to MySelenium2Library class in
python.. with some additional functions in MySelenium2Library class.
Is it possible to share the instance of MySelenium2Library?
Any clue how we can achieve page objects with custom: MySelenium2Library.
Thanks a lot.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#7>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABEmYsMML_WPBaqQIjgsoPOCntInZoANks5r4bDJgaJpZM4NWm1a>
.
|
@boakley - I'd like to use ExtendedSelenium2Library instead of Selenium2Library. I tried your suggestion to create my own base class that redefines se2lib, but I just cannot get that to work. I'm new to python, and I'm not sure what I'm doing wrong. Could you provide a concrete example of how to do this? |
It should be something as simple as this, though I haven't tested it and
likely won't have time for several days:
class CustomPageObject(PageObject):
@Property
def se2lib(self):
return BuiltIn().get_library_instance("ExtendedSelenium2Library")
Then, just have your page objects inherit from CustomPageObject rather than
PageObject
…On Mon, Nov 20, 2017 at 2:40 PM, Steve Fisher ***@***.***> wrote:
@boakley <https://github.com/boakley> - I'd like to use
ExtendedSelenium2Library instead of Selenium2Library. I tried your
suggestion to create my own base class that redefines se2lib, but I just
cannot get that to work. I'm new to python, and I'm not sure what I'm doing
wrong. Could you provide a concrete example of how to do this?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#7 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABEmYky1You3fM4w8NenBCd4DORQSJpUks5s4ePOgaJpZM4NWm1a>
.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You use following to share instance of selenium2library:
BuiltIn().get_library_instance("Selenium2Library")
Now in my case, I extend Selenium2Library to MySelenium2Library class in python.. with some additional functions in MySelenium2Library class.
Is it possible to share the instance of MySelenium2Library?
Any clue how we can achieve page objects with custom: MySelenium2Library. Thanks a lot.
The text was updated successfully, but these errors were encountered: