Atribute error

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • gtb

    #1

    Atribute error



    In file Test1.py below I get a attribute error on the line
    "self.logon ()". It worked earlier when Test1 was derived from class
    newLogon but that does not seem logical to me. Any suggestions?

    Thanks,

    john

    #~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~ ~~~~
    #File Test1.py

    # Generated by MaxQ [com.bitmechanic .maxq.generator .CompactGenerat or]
    #Test1.py

    from CompactTest import CompactTest
    from newLogon import newLogon

    class Test1(CompactTe st):
    # Recorded test actions.
    def runTest(self):
    self.msg('Test started')

    self.logon()

    # ^^^ Insert new recordings here. (Do not remove this line.)


    # Code to load and run the test
    if __name__ == 'main':
    Test1('Test1'). Run()


    #~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~ ~~~~~

    #File newLogon.py
    # Generated by MaxQ [com.bitmechanic .maxq.generator .CompactGenerat or]
    from CompactTest import CompactTest

    class newLogon(Compac tTest):
    # Recorded test actions.
    def logon(self):
    self.msg('Test started')


    # ^^^ Insert new recordings here. (Do not remove this line.)


    # Code to load and run the test
    if __name__ == 'main':
    newLogon('newLo gon').Run()

  • Bjoern Schliessmann

    #2
    Re: Atribute error

    gtb wrote:
    In file Test1.py below I get a attribute error on the line
    "self.logon ()".
    Seems like the class doesn't have this attribute.
    It worked earlier when Test1 was derived from
    class newLogon but that does not seem logical to me.
    What's the definition of CompactTest?

    Regards,


    Björn

    --
    BOFH excuse #143:

    had to use hammer to free stuck disk drive heads.

    Comment

    • gtb

      #3
      Re: Atribute error

      Thanks for posting.

      CompactTest is a class provided by MaxQ and inheritance generally
      works as the files below worked OK. I was trying to re-arrange things
      as newLogin() should be just one of many functions called by Test1.
      The way the inheritance is setup below seems like the tail wagging the
      dog especially since at some point I may no longer want to run the
      logon function.

      Thanks again,

      john

      #~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~ ~
      # File Test1.py
      # Generated by MaxQ [com.bitmechanic .maxq.generator .CompactGenerat or]
      from newLogon import newLogon

      class Test1(newLogon) :
      # Recorded test actions.
      def runTest(self):
      self.msg('Test started')

      self.logon
      # ^^^ Insert new recordings here. (Do not remove this line.)


      # Code to load and run the test
      if __name__ == 'main':
      Test1('Test1'). Run()

      #~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~
      # File newLogon.py
      # Generated by MaxQ [com.bitmechanic .maxq.generator .CompactGenerat or]
      from CompactTest import CompactTest

      class newLogon(Compac tTest):
      # Recorded test actions.
      def logon(self):
      self.msg('Test started')


      # ^^^ Insert new recordings here. (Do not remove this line.)


      # Code to load and run the test
      if __name__ == 'main':
      newLogon('newLo gon').Run()






      Comment

      Working...