Logo QF-Test

Im Archiv der Mailingliste
wertvolle Antworten finden.

 

Gratis Testen  Download  Kaufen

Thomas Max, QF-Test Training und Support

Tipp für die Recherche in der Mailingliste: Volltextsuche (oben) verwenden.

Thomas Max,
Sr. Software Engineer & Trainer, QFS

2016 bis heute 2015 | 2014 | 2013 | 2012 | 2011 2010 2009 | 2008 | 2007

(ältere Archiveinträge vor 2007 nicht dargestellt, aber in der Suche enthalten)

Mailingliste - Einträge 2007


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [QF-Test] Delete a file/folder from the filesystem using script


  • Subject: Re: [QF-Test] Delete a file/folder from the filesystem using script
  • From: "Kelstrup, Louise" <louise.kelstrup@?.com>
  • Date: Thu, 18 Oct 2007 15:09:37 +0200
  • Delivered-to: qftest-list@?.de

Hi

I use this server script to clear an entire directory with subdirectories and files and it works fine:

"import shutil


############################################################
def funcDeletePath(Path):
    try:
        shutil.rmtree(Path,false,rc.logMessage("Directory " + Path + " was not deleted"))
    except(IOError,OSError):
        rc.logMessage("Directory " + Path + " was not deleted.")

#############################################################

# Path = "c:/Temp/"

Path = rc.lookup("PathToDelete")

funcDeletePath(Path)
"

It takes 1 parameter PathToDelete which contain the name of the directory.

regards,

Louise Kelstrup

Mobile: + 45 2373 6049

louise.kelstrup@?.com

-----Original Message-----
From: qftest-list-bounces@?.de [mailto:qftest-list-bounces@?.de] On Behalf Of Martin Moser
Sent: 18. oktober 2007 14:34
To: qftest-list@?.de
Subject: Re: [QF-Test] Delete a file/folder from the filesystem using script

Hello Yossi,

you could also try a server-script node with following content:

import shutil
shutil.rmtree(rc.lookup("directory"))

Regards,
Martin


--On Donnerstag, Oktober 18, 2007 11:23:00 +0200 Yossi Loson
<yossi.l@?.com> wrote:

> Hi Gregor,
>
> Thanks for your answer, I do know about "Execute shell command" node,
> however I am unable to delete a subdir with all its content (including
> the dir itself)
>
> For example in the Directory filed I set the full path to the parent dir
> and under Client field I use "server"  While under shell command I use
> every way I know to delete dir in dos  rd /q <subdir>
> del /q <subdir>
> deltree <subdir>
> del or rd alone
>
> The best result I got so far was removing the content of the subdir but
> that's not enough as I do need to remove the entire subdir
>
> Can you please help here?
>
> Thanks
> Yosi
>
> -----Original Message-----
> From: Gregor Schmid [mailto:Gregor.Schmid@?.de]
> Sent: Wednesday, October 17, 2007 11:07 PM
> To: qftest-list@?.de
> Cc: Yossi Loson
> Subject: Re: [QF-Test] Delete a file/folder from the filesystem using
> script
>
>
> Hi Yossi,
>
> there are many ways. The most convenient probably are using an
> "Execute shell command" node, or using a "Server script" node
> employing Python's shutil package. See
>
> http://www.python.org/doc/2.0.1/lib/module-shutil.html
>
> for details about the latter.
>
> Best regards,
>     Greg
>
> "Yossi Loson" <yossi.l@?.com> writes:
>
>>    Hello,
>>
>>
>>    Can anyone explain how do I delete a file/folder from the file system?
>>
>>    I am working on WinXP and have the latest QFTest version (2.1.0 P3)
>>
>>
>>    Also
>>
>>    I have several test suites I want to run in batch mode, is there a way
>>    to do this?
>>
>>
>>
>>
>>    Thanks



--
Martin Moser                           martin.moser@?.de
Quality First Software GmbH            http://www.qfs.de
Tulpenstr. 41                          Tel: +49 8171 919874
DE-82538 Geretsried                    Fax: +49 8171 919876
GF: Gregor Schmid, Karlheinz Kellerer  HRB München 14083

_______________________________________________
qftest-list mailing list
qftest-list@?.de
http://www.qfs.de/mailman/listinfo/qftest-list


Capgemini Danmark A/S, Registered office: Gentofte, Reg.No. 25606965



This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient,  you are not authorized to read, print, retain, copy, disseminate,  distribute, or use this message or any part thereof. If you receive this  message in error, please notify the sender immediately and delete all  copies of this message.




Videos Downloads Dokumentation Kaufen Gratis Testen