Ask a Question

An attempt to work with Closed Driver on Test Execute 12.31

nishaa123
Contributor

An attempt to work with Closed Driver on Test Execute 12.31

I am getting "An attempt to work with Closed Driver" on Test Execute 12.31 since two days.

When i keep data file open then it execute test cases and  it reads data but after few cases data file get closed and it stopped working .

I am using Excel Driver.

nisha
4 REPLIES 4
Marsha_R
Community Hero

Well, yes that would be expected if the driver is closed.  There's no way for it to find the data after that.

 

It would help if you would post a screenshot of your code from just before the driver is open to just after it's closed so we might be able to see what is happening.


Marsha_R
[Community Hero]
____
[Community Heroes] 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 Heroes]
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 Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
tristaanogre
Esteemed Contributor

This is also an error that happens with a DDT driver if, for some reason, there is a failure in creating the driver.  This can happen if the file is not available, the sheet (if using Excel) is not available, or any number of other things that could cause the failure.

 

If you're using the Jet database engine (3rd parameter of Excel driver or any CSV driver), there are only a limited number of connections that can be open at a time.  So, if you are opening a bunch of driver connections and never calling DDT.CloseDriver for those drivers, you may be running out of available connections... and this could cause a failure to open a driver which would result in the error you are receiving.

 

As @Marsha_R said, a bit more information of what code is generating the error, how you are accessing your data, etc., would be useful


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available

I am closing driver after opening each time using below code

Call DDT.CloseDriver(DDT.CurrentDriver.Name)

 

Same code was running fine last week . Now also it is running fine on few machines on few machine it creating this issue.

I read on community if you keep open the excel file which is used then it will be fine and it works for me but I really don't understand why it is happening and it is also not a good idea to open excel sheets if you are using multiple datasheets.

I also read downloading Microsoft Access database Engine 2010 might resolve problem that doesn't work for me.

The Excel file is stored on C drive . Does it make difference?

 

 

nisha
tristaanogre
Esteemed Contributor

One of the pitfalls of using "CurrentDriver.Name" is that it is possible that the "currentdriver" in use when you go to close the driver may NOT be the one you actually want to close.  I prefer, when using DDT drivers, to actually assign the driver object to a variable that I then call the name property on whenever possible... that way I KNOW what driver I'm closing and not depending upon making sure that "CurrentDriver" is the desired driver.

 

What it sounds like is a possibility is that you MAY be closing the driver when you don't mean to

 

Another thing... using a DDT.ExcelDriver, there's a third property for the ACE driver.  I would recommend setting that to "true" as that might help with some of the problems you may be dealing with.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
cancel
Showing results for 
Search instead for 
Did you mean: