TESTEVERYTHING
Showing posts with label Jmeter. Show all posts
Showing posts with label Jmeter. Show all posts
Tuesday, 22 December 2015
Tuesday, 13 January 2015
HOW TO UNINSTALL JENKINS
How to uninstall Jenkins on Mac system
1. Execute
from terminal
/Library/Application
Support/Jenkins/Uninstall.command
2. Or use
Finder to navigate into that folder and double-click on Uninstall.command.
3. If the
uninstallation script cannot be found, use:
sudo launchctl unload
/Library/LaunchDaemons/org.jenkins-ci.plist
sudo rm
/Library/LaunchDaemons/org.jenkins-ci.plist
sudo rm -rf /Applications/Jenkins
"/Library/Application Support/Jenkins" /Library/Documentation/Jenkins
4. if you
want to get rid of all the jobs and builds:
sudo rm -rf /Users/Shared/Jenkins
5. to delete
the jenkins user and group (if you chose to use them):
sudo dscl .
-delete /Users/jenkins
sudo dscl .
-delete /Groups/jenkins
Thursday, 17 January 2013
Jmeter bean shell script, create file, read jmeter variable value, store script variable value into jmeter variable
Hi All,
Some times in JMeter scripting we need to store the output value in file or wanna show the run time variable value in console window. OR we need to get the current JMeter script directory path. This can be achieved via scripting in Bean Shell Pre/Post Processor.
Here I am using time and counter function of JMeter to create the file.In bean shell scripting we are reading the JMeter variables value and storing script variable value into JMeter variable or creating Jmeter variable
Here is the Bean Shell script :
Some times in JMeter scripting we need to store the output value in file or wanna show the run time variable value in console window. OR we need to get the current JMeter script directory path. This can be achieved via scripting in Bean Shell Pre/Post Processor.
Here I am using time and counter function of JMeter to create the file.In bean shell scripting we are reading the JMeter variables value and storing script variable value into JMeter variable or creating Jmeter variable
Here is the Bean Shell script :
import org.apache.jmeter.services.FileServer;
import org.apache.jmeter.services.FileServer;
import java.util.Date;
import java.text.SimpleDateFormat;
SimpleDateFormat formatter = new SimpleDateFormat( "yyyyMMddHHmmss" );
String datetime = formatter.format( new java.util.Date() );
// Get current running counter value(C refrence name deifned in counter config element)
String counter= vars.get("C");
// Get Jmeter variable value in bean shell script by vars.get method
String timer= vars.get("JmeterTimerVariable");
// here JmeterTimerVariable defined in User Defined variable config element
// Display value in Console
System.out.println("Current counter value = " + counter);
System.out.println("JmeterTimerVariable value = " + timer);
// Store beanshel script variable into Jmeter variable by using vars.put method and we will user this jmetervariable in Wikisearch http request
vars.put("JmeterSearchVariable",datetime+counter);
// get JmeterSearchVariable value in beanshell script
String SearchVariable = vars.get("JmeterSearchVariable");
System.out.println("SearchVariable value = " + SearchVariable);
// Here we can get the directory path of Jmeter script file
String DirPath = FileServer.getFileServer().getBaseDir();
// write into jmeter.log file under Jmeter/bin directory
log.info(DirPath);
System.out.println("Directory path of Jmeter script file = " + FileServer.getFileServer().getBaseDir());
// we will create a file under directory of jmeter script file with name JmeterReords using File system True file will be created if not and data will //append into the file False will create a new file with fresh data
f = new FileOutputStream(FileServer.getFileServer().getBaseDir()+"\\JmeterReords.txt", true);
p = new PrintStream(f);
// write data into file
p.println("Current counter value = " + counter);
p.println("JmeterTimerVariable value = " + timer);
p.println("Directory path of Jmeter script file = " +DirPath);
p.close();
f.close();
// if you want to create unique file for each loop counter refer below script
String uniquefilename = timer+counter;
f = new FileOutputStream(FileServer.getFileServer().getBaseDir()+"\\"+uniquefilename+".log", true);
p = new PrintStream(f);
// write data into file
p.println("Current counter value = " + counter);
p.println("JmeterTimerVariable value = " + timer);
p.println("Directory path of Jmeter script file = " +DirPath);
p.close();
f.close();
Here is the structure of JMeter script
![]() |
| Jmeter bean Shell script |
Tuesday, 10 January 2012
Jmeter: pass a value between threads
Synopsis:
Find
out ways to pass a value between threads (i.e. capturing a value in one of the
thread and passing it to the other thread in the same test plan).
Tool
Used: JMeter:
Performance testing tool.
Solution: Sharing Variables
1)
Used Sampler : BSF Sampler
1) Screenshot displaying the use of the BSF Sampler using ${__setProperty(storeid, ${storeid})}; for
capturing the time. The website used is http://www.mail-archive.com/jmeter-user@jakarta.apache.org/info.html
for displaying the value captured in one thread to the other thread.
Screenshot 1: Displaying the BSF Sampler capturing the time value using ${__setProperty(storetime,
${__time(HMS)})};
Screenshot 2: Displaying the time captured using ${__property(storetime)} in the
other thread.
Screenshot3: Successful execution of the script
displaying the time value captured in Thread2
Subscribe to:
Posts (Atom)
