Testing load document functionality with JMeter?

You may use CSV Data Set Config under While Controller to read and send pre-created test documents names in cycle This will look like: 1 create collection of different test-documents to send with your request OPTIONALLY: store path to folder with created documents as jmeter variable - to use in script 2 create list of test-documents you can do this in BeanShell Sampler with code as shown below 3 add While Controller to send test-documents in cycle CSV Data Set Config to While Controller as child - to read test-documents names from list Detailed: ${__javaScript("${testFile}"! ="",)} to read list till the end of file BeanShell Sampler code to generate test-files list: import java.text. *; import java.io.

*; import java.util. *; String params = Parameters. Split(","); String contentList = params0; String testDataDir = params1; File dir = new File(System.

GetProperty("user. Dir") + File. Separator + testDataDir); BufferedWriter out = null; try { if (!dir.exists()) { throw new Exception ("Directory " + dir.getName() + " not found."); } File contentFile = new File(System.

GetProperty("user. Dir") + File. Separator + contentList); if (contentFile.exists()) { contentFile.delete(); } FileWriter fw = new FileWriter(contentFile, true); out = new BufferedWriter(fw); System.out.

Println("\n--------------------------------------------------------------------------------------"); System.out. Println("CONTENT LIST:\n"); if ((dir.exists()) && (dir.listFiles()! = null) && (out!

= null)) { for (File f : dir.listFiles()) { if (contentFile.length() == 0) { out. Write(f.getName()); } else { out. Write("\n" + f.getName()); } out.flush(); System.out.

Println("Content " + f.getName() + " added to " + contentFile.getName() + ". "); } } System.out. Println("--------------------------------------------------------------------------------------\n"); } catch (Exception ex) { IsSuccess = false; log.

Error(ex.getMessage()); System.err. Println(ex.getMessage()); } catch (Throwable thex) { System.err. Println(thex.getMessage()); } finally { out.close(); }.

You may use CSV Data Set Config under While Controller to read and send pre-created test documents names in cycle. This will look like: 1. Create collection of different test-documents to send with your request; OPTIONALLY: store path to folder with created documents as jmeter variable - to use in script; 2.

Create list of test-documents; you can do this in BeanShell Sampler with code as shown below; 3. Add While Controller to send test-documents in cycle; CSV Data Set Config to While Controller as child - to read test-documents names from list. Detailed: ${__javaScript("${testFile}"!

="",)} - to read list till the end of file BeanShell Sampler code to generate test-files list: import java.text. *; import java.io. *; import java.util.

*; String params = Parameters. Split(","); String contentList = params0; String testDataDir = params1; File dir = new File(System. GetProperty("user.

Dir") + File. Separator + testDataDir); BufferedWriter out = null; try { if (!dir.exists()) { throw new Exception ("Directory " + dir.getName() + " not found. "); } File contentFile = new File(System.

GetProperty("user. Dir") + File. Separator + contentList); if (contentFile.exists()) { contentFile.delete(); } FileWriter fw = new FileWriter(contentFile, true); out = new BufferedWriter(fw); System.out.

Println("\n--------------------------------------------------------------------------------------"); System.out. Println("CONTENT LIST:\n"); if ((dir.exists()) && (dir.listFiles()! = null) && (out!

= null)) { for (File f : dir.listFiles()) { if (contentFile.length() == 0) { out. Write(f.getName()); } else { out. Write("\n" + f.getName()); } out.flush(); System.out.

Println("Content " + f.getName() + " added to " + contentFile.getName() + ". "); } } System.out. Println("--------------------------------------------------------------------------------------\n"); } catch (Exception ex) { IsSuccess = false; log.

Error(ex.getMessage()); System.err. Println(ex.getMessage()); } catch (Throwable thex) { System.err. Println(thex.getMessage()); } finally { out.close(); }.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions