I'm working on an Automation Project where I have to upload a file from the local folder, do some tasks and then repeat the same set of tasks by choosing the next file from the local folder. I have about 20 files stored in the local folder. I have successfully completed the work for a single file, but I don't know how to do it for multiple files by choosing them one by one in a sequence. It's my first project in Python, I'm stuck. The code:
def file_upload(self):
upload_btn = driver.find_element_by_xpath("//") # The Upload Button
upload_btn.send_keys('File location in the local folder')
def job1(self):
#set of actions
def job2(self):
#set of actions
if __name__ == '__main__':
file_upload()
job1()
job2()