I need a help to know how can I can iterate a loop over a array which is in another function of the same class.
I tried using the following similar code for automation in selenium and I get the following error.
class Test: def array_method1(self, product): self.product = product if product == "First": group1 = ['A','B','C'] elif product == "Second": group2 = ['C','D','E'] def iterate_product(self, product): self.product = product for test in self.array_method1(product): browser.find_element_by_name(test).click()
I called the function as
iterate_product('First') and I got the error as:
TypeError: 'NoneType' object is not iterable
Could someone help me on this?