Answered

Execute_command details

How this command works?

My understanding was that with this command I should be able to run something in OS command line.

I tried to run: "del C:\Users\vmelnik\Downloads\Test1_IKN_FileNE.txt" using this method but nothing is happening.

Since option to delete file after download doesn't works as of now in Verify_File_Download method due to the bug, I'm trying to find a way to use Proof step  to delete all files in the downloads folder.

Any suggestions?

0
8 comments

Official comment

Avatar
Rex Feizi

Hi, 

 

Would you please send the entire command as is in the test case. If the command is in quotes you need to do the following: "del C:\\Users\\vmelnik\\Downloads\\Test1_IKN_FileNE.txt"

 

Also, any errors or log outputs you can share would be useful to get some perspective. 

Comment actions Permalink
Avatar
Vitaly Melnik

0
Comment actions Permalink
Avatar
Jonathan Hotz

Hi.

EXECUTE_COMMAND runs command in system, not in console.

Del is Windows cmd command.

So you need to create EXECUTE_COMMAND with 3 arguments (3 lines):

cmd

/c

del C:\Users\vmelnik\Downloads\Test1_IKN_FileNE.txt

0
Comment actions Permalink
Avatar
Vitaly Melnik

Hello,

It's been awhile since last time I used this command and according to this thread it should be working following steps provided in the previous comment. But currently it doesn't work. Could you please check on your side if you can run any command in your command line using this method?

I tried different ways as instructed here "https://subject7.atlassian.net/wiki/spaces/SD/pages/879526007/EXECUTE+COMMAND+Command" and in this thread with no luck. All I want is delete 1 or multiple file in any provided folder using "Execute_Command" method. I tried so many options and spent too much time just trying to figure out how this method works which should not be the case. Maybe you can just provide json script which works on your side so I could copy and try to run on my side?

 

0
Comment actions Permalink
Avatar
Joseph Hamdan

Hi Vitaly,

Could you please send us the command syntax that you are using?

If you can expand the options for Execute_Command and take a screenshot?

Thanks!

Regards,

Subject7 Team

0
Comment actions Permalink
Avatar
Vitaly Melnik

Hi Joseph,

Below are multiple screenshots of what I've tried so far with no luck. Some are passing but file is not getting deleted and still present in the folder.

For option below i'm getting "Cannot run program "del ‪C:\TEST\test.xlsx": CreateProcess error=2, The system cannot find the file specified" message

0
Comment actions Permalink
Avatar
Joseph Hamdan

Hi Vitaly,

The correct way to use command is as below:

cmd

/c

del "C:\TEST\test.xlsx"

This will work as long as the file is not currently being used or open by an application.

Regards,

Subject7 Team

0
Comment actions Permalink
Avatar
Vitaly Melnik

Thank you Joseph,

Your example seems to be working for now. Looks like path string was supposed to be inside the quotation marks.

0
Comment actions Permalink

Please sign in to leave a comment.