**我在这个类中调用类重用的方法** ''
from behave import *
from Functions_Orange.reuse import Reuse
from Resources import Locator
class Orange:
@given('Navigate to organeHRM')
def Navigate_loginPage(context):
print("Testing======Test \n")
print(Locator.Locator_UserName)
Reuse.sendText(Locator=Locator.Locator_UserName,Text=Locator.UserName)
Reuse.sendText(Locator=Locator.Locator_passWord,Text=Locator.Password)
''
这是我创建方法的重用类
from Resources.Driver import *
class Reuse(Driver):
y = Driver()
y.intialise()
def markElement(self,Locator):
self.intialise().find_element_by_xpath(Locator)
def click(self,Locator):
self.intialise().find_element_by_xpath(Locator).click()
def getText(self,Locator):
self.intialise().find_element_by_xpath(Locator)
return self.y.__getattribute__("text")
def sendText(self,Locator,Text):
self.intialise().find_element_by_xpath(Locator).send_keys(Text)
您需要实例化重用并调用该对象上的方法。你知道吗
一些类似的东西:
相关问题 更多 >
编程相关推荐