I’m utilizing Robotic framework to automate a file add to a webpage. I’m utilizing the Select File key phrase.
Code notes: ${CONTINUE_BUTTON} is a button on the backside of the display screen, making certain that the whole backside of the webpage is seen. The Sleeps are there quickly in order that I do know it is not a timing concern and might watch the automation because it occurs.
”’
${uploadFileButton} = xpath://*[@id="67e21641-340b-4f15-94e2-e5ab7a8532a1"]/div/button
${testDoc} = C:UsersjasonbDocumentsDummyDocumentsTestDocument.pdf
Scroll Ingredient Into View ${CONTINUE_BUTTON}
Sleep 10s
Wait Till Ingredient Is Seen ${uploadFileButton}
Select File ${uploadFileButton} ${testDoc}
Sleep 10s
”’
I ensured that the Xpath locator is the right one by looking it in my examine panel. Within the failure screenshots, the button is seen.
After I use the Wait Till Ingredient Is Seen key phrase, I get this error:
”’
Ingredient 'xpath://*[@id="67e21641-340b-4f15-94e2-e5ab7a8532a1"]/div/button' not seen
after 5 seconds.
”’
After I do not use the Wait Till Ingredient is Seen key phrase, I get this error:
”’
Ingredient with locator 'xpath://*[@id="67e21641-340b-4f15-94e2-e5ab7a8532a1"]/div/button'
not discovered.
”’
I additionally tried utilizing a distinct ingredient that’s not the clickable a part of the add file button:
”’
${uploadFileButton} = xpath://*[@id="67e21641-340b-4f15-94e2-e5ab7a8532a1"]/div/button
”’
And acquired this error:
”’
Ingredient with locator 'xpath://*[@id="67e21641-340b-4f15-94e2-e5ab7a8532a1"]' not
interactable.
”’
So it may possibly see the non-clickable ingredient, however not the clickable ingredient just some HTML strains down from it. What is occurring right here?