Bemo on Java with passion
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Bemo Build Status Code Health

Bemo(back-end mock) - it's simple way to mock your back-end from webdriver UI tests.

WARNING: It's framework prototype. Use at your own risk.


Download bemo for java:

$ git clone

Build maven artifact:

$ mvn clean install

Add dependency to your project:



Example usage:

  • Test Class
public class DemoTests {
    private BeMo bemo;
    private ValidatorHandler validatorHandler;

    public void beforeMethod() {

        bemo = new BeMo(getWebDriver()); // Make BeMo instance.
        validatorHandler = new ValidatorHandler(); //Make Bemo Handler.

    public void afterMethod() {
            bemo.release(); //Disable and destroy xhook.

    public void testAddressErrorGoogleRegistration() {
        bemo.addHandler(validatorHandler).inject(); // Register Handler and inject to xhook.


        $(GoogleRegistrationPage.ERROR_MESSAGE).shouldHave(text("It's work."));

        validatorHandler.assertCallCount(1); // Verify that handler was called only once.
        validatorHandler.assertCalledOnceWith(new ValidatorCall()); // Verify that handler was called with this call. 
  • ValidatorHandler
public class ValidatorHandler extends AbstractHandler {

    public ValidatorResponseBody responseBody = new ValidatorResponseBody();

    public Object getBody() {
        return responseBody; // If string than use as is. If Object than will transform to Json via Gson.

    public Map<String, String> getHeaders() {
        return null; // Null was ignoring.

    public String getUrlPart() {
        return "InputValidator"; // This is part of url for setup handler.

    public int getStatus() {
        return 200; // Http status code.
  • ValidatorCall
public class ValidatorCall extends AbstractCall {
    public ValidatorRequestBody body = new ValidatorRequestBody();

    public ValidatorCall() {

    public ValidatorCall(String gmail_address) {
        body.input01.put("GmailAddress", gmail_address);
    public String getMethod() {
        return "POST"; // Http method.
    public String getUrl() {
        return "InputValidator?resource=SignUp"; // Request url.
    public Object getBody() {
        return body; // Request body.
    public Map<String, String> getHeaders() {
        return null; // Null will be ignore in verification.


Bemo use xhook and gson to work.


Fill free to contribute!


Apache License