I am very new and understand little of this. I am trying to automate the download of some documents. Google Chrome Click Link is working perfect to click on this /html/body/form/table[1]/tbody[2]/tr/td/div/table/tbody/tr[3]/td[8]/span [1]
And it's fine when it's only 1 link that is presented. But when there are several links I want to download only the most recent one. For example
/html/body/form/table[1]/tbody[2]/tr/td/div/table/tbody/tr[3]/td[8]/span[1]
/html/body/form/table[1]/tbody[2]/tr/td/div/table/tbody/tr[4]/td[8]/span[1]
/html/body/form/table[1]/tbody[2]/tr/td/div/table/tbody/tr[5]/td[8]/span[1]
/html/body/form/table[1]/tbody[2]/tr/td/div/table/tbody/tr[6]/td[8]/span[1]
I only want to click on link #4 but if link number 4 is not available then download link number 3 and stop, and don't download the next ones. Sometimes there can be up to 6 links, I would like you to check if link 6 is available, if not, check 5, if not 4 and if 4 is available download it.
I tried If this Then Else but it only works with 2 links, and when I try to nest multiple If this... functions it fails.
Note: I'm noob to use java or something like that.