PagnationButtons = []
class Xpather:
def __init__(self,Xpath):
self.Xpath = Xpath
self.object = driver.find_elements(By.XPATH,Xpath)
def Wait(self):
return Wait60s.until(EC.presence_of_all_elements_located((By.XPATH,self.Xpath)))
class PagElement:
def __init__(self,element):
self.element = element
self.index = self.Checkpags()
def Checkpags():
if PagnationButtons != []:
ElementIndex = PagnationButtons[-1].index;
return ElementIndex + 1
else:
return 1
Hello i am trying to make a variable that gives its self an index bassed on the last index of an array. It gives this error:
TypeError: PagElement.Checkpags() takes 0 positional arguments but 1 was given
I searched the error but the answers did not give me a solution that worked.
I made an if statement that if the array isnt empty it gives an index bassed on the last array element
What am i doing wrong?