I need to monthly download a report from this page and this is always the first button " Télécharger le fichier modèle V2" that I need to downlaod but my problem is that the button can be 1 month at the position and then at the second position …
So maybee am wrong but I trying to use xClick to do this, but the task stop and it seems it don’t know which button to click and I don’t know how to select the first button (1.00 #1) ?
Let me know if I’m doing it in the wrong way
Probably something like:
Click //button[text()='Télécharger le fichier modèle V2'][1] First row //button[text()='Télécharger le fichier modèle V2'][2] Second row, etc.
If you can post the link we can look at the selectors for that button
Yes this is what I’m doing xClick, but when executing xClick, it adds some strange numbers (N°1 to number 5) on the page as you can see and nothing happen … I think xClick don’t know which one to click, but I don’t know what to do then ?
If there are a few images that match the input image, normally the best match is selected. But you can force UI.Vision to select another match at a certain position with #. So to click the 3rd matching image (counted from top left to bottom right) use image#3 or image@conf.Level#3.
To solve this hard case i use my method, I search in the page an anchor (usually the button of the element to find) and I make Xclick on the anchor to set focus after with KEY_TAB I move the focus in my element to find and when focus is over the element to find I click KEY_ENTER or another combination to download the element in focus (right mouse button and save or similar).
I do not suggest to use image recognition because it’s very easy do not work because can be affected from the windows resolution and responsive site that change and image recognition require always same resolution and same screen size.
KEY_TAB is universal and working always in same mode with all resoluition.
More simple is the macro code and more stable will be, click is the best solution.
If you need to click another link in the same page you can use the POS=N to choice prefered link
Position support in link text locator
With CLICK link=Download@POS=3 you instruct the IDE to use the n-th (here n=3) occurrence of a locator. This is useful, for example, if a have a website with many download links, and you want to click the n-th once. POS is only supported with the “normal text” locator link=… but not with XPATH and CSS selectors.