jonathon
5 years agoContributor
Python BDD modules
Hi
Just getting started with TestComplete and BDD. I'm experienced with Python BDD (Behave) with Selenium. Just a little unsure how to work with python modules. I can't seem to import my classes currently. Wondered if anyone could point me in the right direction. I also wasn't sure how to create a .py file.
I included a file named "test", with no extension inside my Scripts folder. But not sure how to import that class into my step definitions?
Ok, I managed it like this:
import login as login_object
login = login_object.Login.get_instance()
My Class is like this though:
class Login: instance = None @classmethod def get_instance(cls): if cls.instance is None: cls.instance = Login() return cls.instance
login = Login.get_instance()So looks a bit ugly, but does work. But if anyone has a better solution that would be cool