Forum Discussion

mlsomers's avatar
mlsomers
New Contributor
14 years ago

How to delete a file

I'm in a keyword test editor workspace screen.

From the operations list I drag and drop the Run Code Snippet operation into my testitems treeview.

In the Specify code dialog, I entered the following line:



aqFileSystem.DeleteFile("G:\MyDir\MyFile.ext")



When I run the test, I don't get any error and the file does not get deleted.

What am I missing?



By the way, is there any way I can extend the "operations" toolbox with my own custom standard operations such as filesystem (delete, copy, move), windows services (starting, pausing, stopping etc...)



Thanks in advance,

Louis

1 Reply

  • Hi Louis,


    I am guessing that you are working with a JScript, C#Script
    or C++Script project. In this case, you need to double slashes in text
    constants:

    aqFileSystem.DeleteFile("G:\\MyDir\\MyFile.ext")



    By the way, is there any way I can extend the
    "operations" toolbox with my own custom standard operations such as
    filesystem (delete, copy, move), windows services (starting, pausing, stopping
    etc...)
    You can create a script extension that will contain any number
    of custom operations. Please find more information in the
    [url=http://www.automatedqa.com/support/viewarticle/12017/]Creating Keyword
    Test Operations[/url] help topic.