Answered

Issue with File Upload for element with no File tag

Hello, I have a File upload element that has no File tag that we were unable to capture to automate file uploads; please see screenshot below.

I saw this post from 2021..

https://subject7.zendesk.com/hc/en-us/community/posts/1500000472922-Unable-to-perform-file-upload-as-their-no-type-file-

 

.. can you confirm if this is applicable? Also will there be future updates to File Uploads that will not be dependent on File tag? This reported Element is in Angular and there is no file tag in use for it. thanks.

0
15 comments
Avatar
Joseph Hamdan

Hi Stephen,

Did you find any element using this XPath? Even if it's not in the same area as this span.

//input[@type='file']

Regards,
Subject7 Team

0
Comment actions Permalink
Avatar
Abayomi Akinpelumi

Hi Joseph, no there is no element for that; please see provided screenshot refencing the element in question.

0
Comment actions Permalink
Avatar
Joseph Hamdan

Hi Stephen,

I did see the image, but I mean did you find one at all, not necessarily in the same area as the span. Would you please check in Console tab?

You can use $x("//input[@type='file']")

Regards,
Subject7 Team

0
Comment actions Permalink
Avatar
Abayomi Akinpelumi

Hi Joseph, I did search and there is no element showing for this.

0
Comment actions Permalink
Avatar
Rex Feizi

Stephen, 

Regarding the file upload automation for the drop zone, it seems we need custom JavaScript. For consistent/stable automation, the file must be dynamically downloaded from our server. Essentially, for consistency, the file should be in a predictable location.

Could you tell me how many steps are typically involved in these flows and how many flows require this? Also, does an 'input type=file' appear in the HTML when uploading? Could you please check with your dev team for insights on the app design? It will help immensely as we have no visibility. 

0
Comment actions Permalink
Avatar
Abayomi Akinpelumi

Good morning, my apologies for my late response. Rex, yes as you mentioned the file being uploaded in the UI would be initially uploaded as a File Upload artifact in PROOF.

Please see screenshot below, the FOAM application's Angular screen only has a Drop element and no 'input type=file' element; the flow is as follows...

1. Select either the Checked out for Review or Available for Review buttons

2. Select an attachment type from the Attachment Type dropdown

3. Drag a file (docx, pdf, etc) to the 'Drop a file here or click to upload' element, or click on it to find an file from Windows Explorer.

... I can be available to provide a demo of the issue via gotomeeting, thanks.

0
Comment actions Permalink
Avatar
Rex Feizi

Right, since this is custom, we can't use the standard file upload command in Subject7. Given we don't have access to the application with the custom control, could you please check the following idea:

FILL Xpath=//dropzone with Value=c:/somefile.txt

Then, submit the form.

Also, please check different elements under dropzone for XPath, for instance, //dropzone/div or //dropzone/div/div, etc.

This isn't to say this will be the definitive solution, but if it works, it could give us some ideas on how to possibly integrate this into our FileUpload command or find another way for robust automation. 

Thank you.

 

0
Comment actions Permalink
Avatar
Abayomi Akinpelumi

Hi Rex, I gave it a try; for these xpaths (//div/app-file-upload/dropzone, //div/app-file-upload/dropzone/div) it passed with the following message in the logs but did not upload anything... 

[INFO] Web element was found with '//div/app-file-upload/dropzone'
[INFO] Step index=88 PASS 1901(ms) [Fill  target element with "C:\\Users\\akinpelumia\\Downloads\\1-AddEquip-ProjectY3.pdf"   ] message='XPath: "//div/app-file-upload/dropzone" was used'

... for these xpaths (//div/app-file-upload/dropzone/div/div, //div/app-file-upload/dropzone/div/div/div, //div/app-file-upload/dropzone/div/div/div/span) it gave these errors below; screenshot is attached.

INFO] Attempting to find locator "//div/app-file-upload/dropzone/div/div" using XPath "//div/app-file-upload/dropzone/div/div"
[DEBUG] Looking for element://div/app-file-upload/dropzone/div/div
[DEBUG] WaiStrategy timeout=2000
[INFO] Attempting to find locator "//div/app-file-upload/dropzone/div/div" using XPath "//div/app-file-upload/dropzone/div/div"
[DEBUG] WaiStrategy timeout=30000
[INFO] Web element was found with '//div/app-file-upload/dropzone/div/div'
[INFO] Step index=88 FAIL 1103(ms) [Fill  target element with "C:\\Users\\akinpelumia\\Downloads\\1-AddEquip-ProjectY3.pdf"   ] message='element not interactable. Driver: Chrome Driver. Version: 121.0.6167.85.'
[DEBUG] Test case execution has been completed
[INFO] Test execution id=0 finished. Status='FAIL', Message='Execution failed at step 89. Message element not interactable. Driver: Chrome Driver. Version: 121.0.6167.85.'
[DEBUG] Execution has been completed
[DEBUG] Execution service shutdown complete
[DEBUG] Player base URL=https://proof.era.nih.gov, Website URL=https://proof.era.nih.gov
[DEBUG] Player base URL=https://proof.era.nih.gov, Website URL=https://proof.era.nih.gov
[DEBUG] Player base URL=https://proof.era.nih.gov, Website URL=https://proof.era.nih.gov
[DEBUG] Start execution
[DEBUG] Start execution preparation
[DEBUG] Executing the following command: [cmd.exe /C wmic datafile where name="%PROGRAMFILES:\=\\%\\Google\\Chrome\\Application\\chrome.exe" get Version /value]
[DEBUG] The result of the command [cmd.exe /C wmic datafile where name="%PROGRAMFILES:\=\\%\\Google\\Chrome\\Application\\chrome.exe" get Version /value] is 'Version=121.0.6167.185'
[DEBUG] Executing the following command: [C:\Users\akinpelumia/.proof/drivers\chrome-driver-win64.exe, -v]...
[DEBUG] The result of the command [C:\Users\akinpelumia/.proof/drivers\chrome-driver-win64.exe, -v] is 'ChromeDriver 121.0.6167.85 (3f98d690ad7e59242ef110144c757b2ac4eef1a2-refs/branch-heads/6167@{#1539})'
[DEBUG] Executing the following command: [C:\Users\akinpelumia/.proof/drivers\chrome-driver-win64.exe, -v]...
[DEBUG] The result of the command [C:\Users\akinpelumia/.proof/drivers\chrome-driver-win64.exe, -v] is 'ChromeDriver 121.0.6167.85 (3f98d690ad7e59242ef110144c757b2ac4eef1a2-refs/branch-heads/6167@{#1539})'
[DEBUG] Execution preparation has been completed
[DEBUG] Start test case execution
[INFO] Selenium=4.16.1 Test execution id=0 start, number of steps 100
[INFO] Browser - 'Chrome'; Version - '121.0.6167.185'; Web Driver Version - '121.0.6167.85'
[INFO] Attempting to find locator "//div/app-file-upload/dropzone/div/div/div" using XPath "//div/app-file-upload/dropzone/div/div/div"
[DEBUG] Looking for element://div/app-file-upload/dropzone/div/div/div
[DEBUG] WaiStrategy timeout=2000
[INFO] Attempting to find locator "//div/app-file-upload/dropzone/div/div/div" using XPath "//div/app-file-upload/dropzone/div/div/div"
[DEBUG] WaiStrategy timeout=30000
[INFO] Web element was found with '//div/app-file-upload/dropzone/div/div/div'
[INFO] Step index=88 FAIL 898(ms) [Fill  target element with "C:\\Users\\akinpelumia\\Downloads\\1-AddEquip-ProjectY3.pdf"   ] message='element not interactable. Driver: Chrome Driver. Version: 121.0.6167.85.'
[DEBUG] Test case execution has been completed
[INFO] Test execution id=0 finished. Status='FAIL', Message='Execution failed at step 89. Message element not interactable. Driver: Chrome Driver. Version: 121.0.6167.85.'
[DEBUG] Execution has been completed
[DEBUG] Execution service shutdown complete
[DEBUG] Player base URL=https://proof.era.nih.gov, Website URL=https://proof.era.nih.gov
[DEBUG] Player base URL=https://proof.era.nih.gov, Website URL=https://proof.era.nih.gov
[DEBUG] Start execution
[DEBUG] Start execution preparation
[DEBUG] Executing the following command: [cmd.exe /C wmic datafile where name="%PROGRAMFILES:\=\\%\\Google\\Chrome\\Application\\chrome.exe" get Version /value]
[DEBUG] The result of the command [cmd.exe /C wmic datafile where name="%PROGRAMFILES:\=\\%\\Google\\Chrome\\Application\\chrome.exe" get Version /value] is 'Version=121.0.6167.185'
[DEBUG] Executing the following command: [C:\Users\akinpelumia/.proof/drivers\chrome-driver-win64.exe, -v]...
[DEBUG] The result of the command [C:\Users\akinpelumia/.proof/drivers\chrome-driver-win64.exe, -v] is 'ChromeDriver 121.0.6167.85 (3f98d690ad7e59242ef110144c757b2ac4eef1a2-refs/branch-heads/6167@{#1539})'
[DEBUG] Executing the following command: [C:\Users\akinpelumia/.proof/drivers\chrome-driver-win64.exe, -v]...
[DEBUG] The result of the command [C:\Users\akinpelumia/.proof/drivers\chrome-driver-win64.exe, -v] is 'ChromeDriver 121.0.6167.85 (3f98d690ad7e59242ef110144c757b2ac4eef1a2-refs/branch-heads/6167@{#1539})'
[DEBUG] Execution preparation has been completed
[DEBUG] Start test case execution
[INFO] Selenium=4.16.1 Test execution id=0 start, number of steps 100
[INFO] Browser - 'Chrome'; Version - '121.0.6167.185'; Web Driver Version - '121.0.6167.85'
[INFO] Attempting to find locator "//div/app-file-upload/dropzone/div/div/div/span" using XPath "//div/app-file-upload/dropzone/div/div/div/span"
[DEBUG] Looking for element://div/app-file-upload/dropzone/div/div/div/span
[DEBUG] WaiStrategy timeout=2000
[INFO] Attempting to find locator "//div/app-file-upload/dropzone/div/div/div/span" using XPath "//div/app-file-upload/dropzone/div/div/div/span"
[DEBUG] WaiStrategy timeout=30000
[INFO] Web element was found with '//div/app-file-upload/dropzone/div/div/div/span'
[INFO] Step index=88 FAIL 1039(ms) [Fill  target element with "C:\\Users\\akinpelumia\\Downloads\\1-AddEquip-ProjectY3.pdf"   ] message='element not interactable. Driver: Chrome Driver. Version: 121.0.6167.85.'
[DEBUG] Test case execution has been completed
[INFO] Test execution id=0 finished. Status='FAIL', Message='Execution failed at step 89. Message element not interactable. Driver: Chrome Driver. Version: 121.0.6167.85.'
[DEBUG] Execution has been completed
[DEBUG] Execution service shutdown complete

 

0
Comment actions Permalink
Avatar
Abayomi Akinpelumi

Hello, I would like to follow up on this issue; I am available to meet on this; thanks.

0
Comment actions Permalink
Avatar
Joseph Hamdan

Hi Stephen,

Apologies for the delay in response. Are you available this Friday at 10, 11 or 12 EST ?

Regards,
Subject7 Team

0
Comment actions Permalink
Avatar
Joseph Hamdan

Hi Stephen,

Please note that replies are not accepted via email, it would be great to confirm here.

We are available only at the times we suggested. Can we meet next week if they are not suitable for you?

Regards,
Subject7 Team

0
Comment actions Permalink
Avatar
Abayomi Akinpelumi

let's do it for next week. let me know your availablity.

0
Comment actions Permalink
Avatar
Joseph Hamdan

Hi Stephen,

Are you available this Thursday (June 6th) at 12 PM EST ? If not, I'll check schedule for next week.

Regards,
Subject7 Team

0
Comment actions Permalink
Avatar
Abayomi Akinpelumi

that is perfect, i will be free

0
Comment actions Permalink
Avatar
Joseph Hamdan

Issue resolved, the input tag was displayed in the bottom of the page, so it was not in the same area during inspection.

Regards,
Subject7 Team

0
Comment actions Permalink

Please sign in to leave a comment.