Generate Xpath for Thumbnail file input element using parent element.
id of input element is randomly? generated on page load.
- [ ] Generate Xpath for Thumbnail file input element using parent element.
id of input element is randomly? generated on page load.
![image](/attachments/6fdca7f5-df47-4d62-843e-225db98bd44a)
If it's the only file input on the screen, you can do //input[@type="file"]. Perhaps you can scope it within div[class="uploadfile-wrapper"] or div[class="custom-thumb-uploader"] if there are others.
If it's the only file `input` on the screen, you can do `//input[@type="file"]`. Perhaps you can scope it within `div[class="uploadfile-wrapper"]` or `div[class="custom-thumb-uploader"]` if there are others.
It's been a while since I've done XPath, but something like this should (hopefully) work:
`//div[@class="custom-thumb-uploader"]//input[@type="file"]`
https://devhints.io/xpath
I tried this and a couple other ways, but sadly could not get it to work.
I was able to figure out a way to generate the Xpath using another element above it.
I need to spend a bit of time and expand my knowledge of xpaths, thanks for the devgints website
> It's been a while since I've done XPath, but something like this should (hopefully) work:
> `//div[@class="custom-thumb-uploader"]//input[@type="file"]`
>
> https://devhints.io/xpath
I tried this and a couple other ways, but sadly could not get it to work.
I was able to figure out a way to generate the Xpath using another element above it.
I need to spend a bit of time and expand my knowledge of xpaths, thanks for the devgints website
As it says on the tin.
id of input element is randomly? generated on page load.
If it's the only file
input
on the screen, you can do//input[@type="file"]
. Perhaps you can scope it withindiv[class="uploadfile-wrapper"]
ordiv[class="custom-thumb-uploader"]
if there are others.It's been a while since I've done XPath, but something like this should (hopefully) work:
//div[@class="custom-thumb-uploader"]//input[@type="file"]
https://devhints.io/xpath
I tried this and a couple other ways, but sadly could not get it to work.
I was able to figure out a way to generate the Xpath using another element above it.
I need to spend a bit of time and expand my knowledge of xpaths, thanks for the devgints website