Utility batch (shell) for running Jmeter test plan from command line

Helpful or running jmeter scripts in non GUI mode using shell script

Tri Nguyen's Blog

As far as you know:

  • We have two ways to run a Jmeter test plan through GUI (Windows only) and Non-GUI mode. Read more at here.
  • But it’s recommended that you run the test plan through Non-GUI mode for performance testing. The GUI mode is only used when you develop and debug the test scripts.
  • If you run with Non-GUI mode, you should use the utility batch (shell) file that will be mentioned in this post. It will help to generate the log and result files with including the time in name file and is put in a date folder. For instance: “TestProject_175854.log” and “TestProject_175854.csv”
  • The following steps will introduce with you how to use the utility batch (shell) file to run Jmeter test plan in silent mode (Non-GUI) for both environment Windows and Linux:

1. Utility file:
You can create a batch file likes this:

shell file will…

View original post 303 more words

Utility batch (shell) for running Jmeter test plan from command line

Firefox profile for downloading files to your project folder using Selenium

easyseleniumtestblog

Here I am giving an idea how to download the files while running your selenium scripts by configuring the Firefox profile before instantiating the webDriver

String downloadsPath= System.getProperty(“user.dir”); //This will get you the project root folder path//
downloadsPath=downloadsPath+”downloads”; //auto creation of folder “downloads” inside your project folder
System.out.println(downloadsPath);
downloadsPath=downloadsPath.replace(“”, “”);
FirefoxProfile profile = new FirefoxProfile();
profile.setPreference(“browser.download.folderList”, 2);
profile.setPreference(“browser.download.manager.showWhenStarting”, false);
profile.setPreference(“browser.download.dir”, downloadsPath);
profile.setPreference(“browser.helperApps.neverAsk.openFile”,”text/xml”); // MIME Type
profile.setPreference(“browser.helperApps.neverAsk.saveToDisk”,”text/xml”);                

WebDriver driver=newFirefoxDriver(profile);
Take care of below things before proceeding.
1) MIME type or Content type should match with download file, you can verify the content type using “Net” tab of firebug plugin
Eg:
Content-Type text/html; text/xml; application/pdf

For more details refer: https://en.wikipedia.org/wiki/Media_type

2) Make sure “browser.download.folderList” set to “2”

3) Make sure the download path is valid.

View original post

Firefox profile for downloading files to your project folder using Selenium