Calling A Variable From Another Method In The Same Class
My scenario I only have one class with two methods. In the first method I store values in a variable. In the second method I try to call these variables class UpdateTallysheet(Page
Solution 1:
You need to set it to an instance variable by using self
:
classUpdateTallysheet(Page):
defconfirme_status_capture_exp_value(self):
self.select_dropdown_value(EventsLocators.STATUS, "8")
self.value_1 = self.find_element(EventsLocators.EXAM_EXP_VALUE).get_attribute("value")
self.value_2 = self.find_element(EventsLocators.PANO_EXP_VALUE).get_attribute("value")
self.value_3 = self.find_element(EventsLocators.TREATMENT_EXP_VALUE).get_attribute("value")
Then you can use it in another method by using self.value_1
Post a Comment for "Calling A Variable From Another Method In The Same Class"