类方法在Selenium中不起作用

时间:2017-07-05 14:09:13

标签: python class selenium methods

我是Python和Selenium webdriver的新手,在尝试在另一个脚本中调用以下类方法时遇到了麻烦:

class SharedTestSteps():
  def SharedLogin(self, login, password, getsubmit):
    self.login = self.driver.find_element_by_id('loginField')
    self.password = self.driver.find_element_by_id('passwordField')
    self.login.send_keys("joe")
    self.password.send_keys("password")
    self.getsubmit = self.driver.find_element_by_id('loginSubmitButton')

当我运行脚本时,我收到以下消息,说明没有发生任何事情:

----------------------------------------------------------------------
Ran 0 tests in 0.000s

OK

0 个答案:

没有答案