public void displayPopupWindow(View view) {
    LayoutInflater layoutInflater =
        (LayoutInflater) getBaseContext().getSystemService(LAYOUT_INFLATER_SERVICE);
    View popupView = layoutInflater.inflate(io.selendroid.testapp.R.layout.popup_window, null);
    final PopupWindow popupWindow =
        new PopupWindow(popupView, LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);

    Button btnDismiss =
        (Button) popupView.findViewById(io.selendroid.testapp.R.id.popup_dismiss_button);
    btnDismiss.setOnClickListener(new Button.OnClickListener() {

      @Override
      public void onClick(View v) {
        // TODO Auto-generated method stub
        popupWindow.dismiss();
      }
    });
    Button btnOpenPopup = (Button) findViewById(io.selendroid.testapp.R.id.showPopupWindowButton);
    popupWindow.showAsDropDown(btnOpenPopup, -50, -300);
  }
Demo project to verify selendroid actions.

@author ddary
selendroid-test-app/src/main/java/io/selendroid/testapp/HomeScreenActivity.java