I want to delete the input file that is in a data loop - I get the error stating the file is in use.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I want to delete the input file that is in a data loop - I get the error stating the file is in use.
How do I make TestComplete release the input file so it can be deleted? I use Python code for the delete code (which works) but if I run the program with the input file and then try to delete the file I get the error :
The process cannot access the file because it is being used by another process.
The file type is an Excel file. The file is downloaded from SharePoint and then used as an input file. The file needs to be deleted after the program runs so the next run can use the new file (same name) which has been updated with new data.
I looked for a close command with aqFile & aqfileSystem but didn't find it in the documentation.
The delete script is after the EOF has been reached. Please help!
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
> in a data loop
> delete script is after the EOF has been reached.
Without seen actual code my suggestion will be to try to delete the file outside of the loop.
/Alex [Community Champion]
____
[Community Champions] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Champions]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Champion] signature is assigned on quarterly basis and is used with permission by SmartBear Software.
https://community.smartbear.com/t5/Community-Champions/About-the-Community-Champions-Program/gpm-p/252662
================================
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
If you want be sure that Cursour is in EOF or File is not in use,
You can use WITH keyword in Python.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
it is the last thing to be done after the the last record has been read. Do you know a way to close the input file?
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The delete the file is outside of the loop.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I suppose the file may be locked until you close TestComplete. It is hard to say more without an example.
Yuriy Peshekhonov
Customer Care Engineer
