I searched for a while for this one and was surprised i couldn't find anything, maybe because it's simple. I've been programming in python for about 3 months doing automated testing with selenium webdriver. I was thinking it would be convenient to have a class inherit from my webdriver class to add more functionality to it.
from selenium import webdriver
class myPage(webdriver):
def __init__(self):
super(myPage, self).__init__()
def set_up(self):
#doStuff...
but when i do this i get the error>>>
File "c:\Users\me\...\myProgram.py", line 6, in <module>
class myPage(webdriver):
TypeError: module.__init__() takes at most 2 arguments (3 given)
When I create the myPage object the code is...
from myProgram import myPage
class Test():
def do(self):
self.browser = myPage.Firefox()
So it goes through and does the self.browser = myPage.Firefox() line and when it runs the .__init__() somehow it gives it three arguments and I'm not sure where they come from. I'm clearly missing something because inheritance isn't hard to do. Thanks for any help