Webtestit 1.10.00 (python-based tests, first steps) - issue with POM object creation


Subj. So it brings the fatal error

Traceback (most recent call last):
File “K:\z_Ranorex\tests\qa_ac_ass.py”, line 16, in test_the_title
qa_ac_ass = QaAcAss(driver)
File “k:\python38\lib\unittest\case.py”, line 437, in init
testMethod = getattr(self, methodName)
TypeError: getattr(): attribute name must be string

of course it is about some configuration

suggestion workaround

  • i added hardcoded name ‘init’ for the object, so to move forward

      if type(methodName) != 'string':
              methodName = '__init__'

how to improve - add the verification before try{}
and reasonable KB-hint - what to do


issue resolved…
what was wrong - import instruction was not generated by the “wizard”

from pageobjects.qa_ac_ass import QaAcAss


Ok, thank you for the update!
Yes, all the page object files are not immediately imported to the test file, so they need to be imported manually.