How to fix error in JMeter Thread: Cannot find firefox binary in PATH

  Apache JMeter ERROR – jmeter.threads.JMeterThread: Test failed! org.openqa.selenium.WebDriverException: Cannot find firefox binary in PATH. Make sure firefox is installed. This error occurs because you either have two different Firefox version installed or the app directory PATH is incorrect. To fix this you need to edit JMeter properties and locate the path. 1. Go to Apache JMeter […]

Running Selenium Webdriver Scripts in JMeter

Prerequisites Download the latest version of JMeter (I am using 3.0 r1743807) Download jmeter-plugins-manager-0.5.jar file and put it into lib/ext directory, then restart JMeter. Let’s get started Install the add ons using the JMeter plugin manager. Create a new JMeter Project Add a User Thread Group Add a Webdriver Sampler Add the Chrome […]

Convert String to Proper or Title case

public static String toTitleCase(String input) { final String ACTIONABLE_DELIMITERS = ” ‘-/”; // these cause the character following // to be capitalized StringBuilder sb = new StringBuilder(); boolean capNext = true; for (char c : input.toCharArray()) { c = (capNext) ? Character.toUpperCase(c) : Character.toLowerCase(c); sb.append(c); capNext = (ACTIONABLE_DELIMITERS.indexOf((int) c) >= 0); // explicit cast not […]

Webdriver FluentWait

public Wait wait; WebDriver driver = new FirefoxDriver(); wait = new FluentWait(driver) .withTimeout(360, TimeUnit.SECONDS) .pollingEvery(5, TimeUnit.SECONDS) .ignoring(NoSuchElementException.class); public WebElement fluentWait(final By locator) { WebElement foo = wait.until( new Function() { public WebElement apply(WebDriver driver) { return driver.findElement(locator); } } ); return foo; } public WebElement webElement(final By by) { return wait.until(ExpectedConditions.presenceOfElementLocated(by)); } public WebElement webElementVisible(final […]


public void checkCondition(boolean condition, String message) throws IOException { try { assertTrue(condition); System.out.println(message); } catch (AssertionError e) { message = message.contains(“is displayed”) ? message.replace(“is displayed”, “is not displayed”) : message.contains(“is disabled”) ? message.replace(“is disabled”, “is not disabled”) : message.contains(“is enabled”) ? message.replace(“is enabled”, “is not enabled”) : message.contains(“is not enabled”) ? message.replace(“is not enabled”, “is […]