If your store has floating elements like pop up modals for promotional content, newsletters sign forms or live chat windows, then you may have noticed they can sometimes get in the way when Robot Ninja is trying to interact with other elements on your store.

Thankfully you can tell Robot Ninja to close or minimize these by using our custom selectors feature.

How to use custom selectors to close pop up modals

If you already have the CSS selector to close the pop-up, jump to 4.

1. Within Chrome, Firefox or Safari, go to any URL on your store where the pop up exists

2. Right click on the link/button which closes the modal and click Inspect (screenshot below is using chrome). 

Opening up the inspect tool lets you see the HTML which makes up the current web page. The reason we say to right click on the close link/button is because doing this will take you directly to the HTML of the element we're interested in.

3. Find a CSS selector on the close link/button. Look for unique ID or class attributes that aren't used for other elements on the page (class="mc-closeModal").

4. Set the custom selector for "Close the pop-up modal on store"  in Robot Ninja by going to Store > Settings > Selectors from the Dashboard.

5. Click the update button and queue up your tests again 🎉

Custom selectors to close pop-ups from common plugins

MailChimp (sign up form): class mc-closeModal
Pop-up Maker: class popmake-close or class pum-close
Hustle Pop-ups:
class hustle-i_close 

Other helpful links

FAQ

1. How do I tell if a pop up was blocking?

Screenshot

Robot Ninja records a screenshot on every failed test. This screenshot can be used to diagnose whether there was any floating elements covering the element Robot Ninja tried to interact with.

Error Message

If Robot Ninja's action was blocked because another element was covering the element they tried to interact with then the error message will usually say something like:

  • Robot Ninja could not fill in the X field because it was being covered by <Y>.
  • Robot Ninja was unable to click the element on the page. The element was being covered by <Y>.
Did this answer your question?