TestProject Forum
Powered by leading experts in the test automation community

File uploading addon fails during runtime to upload file

While recording the script to upload a file and adding file path , the test is completely working fine.Whereas while running the test the upload file feature fails to load the test and gives the below error :slight_smile:

java.util.concurrent.ExecutionException: io.testproject.java.sdk.v2.exceptions.FailureException: Element must have the ‘type=file’ attribute!
Caused by io.testproject.java.sdk.v2.exceptions.FailureException: Element must have the ‘type=file’ attribute! at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)

Hello @rvignesh,
Were you always able to upload the file during recording, but fail in execution?
Can you please try to upload the file again in the recorder and write here if you were succeeded?

While recording I am able to execute the test step, But while running the whole test it fails.

I tried with another website but still getting the same error message. But this time it fails during the recording part itself. Am i missing something ?

Doble shifted on the “Click here” element button and added the path value.

Hello @rvignesh
Can you please show me the attributes of that element.

Attributes of the “Upload” button.

This is also another website where the same issue comes.

Can you try this action instead
image

With the xpath value of //input[@type=‘file’]