简体   繁体   中英

Unable to delete %temp% files created due to Selenium Grid

I have a grid configuration where the node is a windows 7 machine configured to run IE9 browser. Test Cases are running fine but after some time the browser gets slow. While searching I found out that it was due to the temp files created by the Selenium Grid NODE .

After clearing the Temp files created by the NODE the browser worked fine.

Now I need a way to clear the temp files on the NODE after a Test Case finishes execution or before starting a Test Case execution.

I tried to clear the system temp files from my Java code but this won't work in Grid configuration as the code runs in the HUB not NODE .

Is there any solution??

I've run into something very similar.

The system that I use, is a combination between selenium 1, and selenium 2 on a grid server on the intranet, which goes out to the AWS which is connected to several hundred nodes.

Each one of these nodes, once they start up the selenium server to run tests as a node, once that server is shut down, it will execute a batch file which just loops through each folder and deletes it in the temp folder.

You can use PsExec to execute a batch file that does the cleanup on the node machine.

Obtain the node address to use in the psexec command by making a POST call to the grid

http://<yourhub:port>/grid/api/testsession?session=" + driver.getSessionId()

The returned JSON will contain the session information, including the address of the node.

You can find sample code to get the node IP here .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM