0

How can I make an method that would return the attribute value from a class by specyfing it's name in a String. So for example I would like for it to look like this but instead of getting attribute "locator_name" it should return the attribute that would be named as value of given locator_name

class HoursPage(BasePage):
    

    locator1 = By.ID, "locatorID"
    locator2 = By.ID, "locatorID2"
    locator3 = By.ID, "smthelse"
    
def get_locator(self, locator_name):
    return self.locator_name

So `

get_locator(locator3)

` Should return locator3 attribute value.

0 Answers0