Its purpose is to guard that the interaction of the user will raise specific request to the server. It differs between following types:
- No Request
- XHR Request (AJAX)
- HTTP Request (regular HTTP)
You can create new RequestGuard with given type defined in constructor:
More intuitive and also preferred way of usage is the usage of Graphene Utility static members:
Internally, factory creates immutable copy of CommandInterceptionProxy and also AjaxSelenium and returns this modified copies, thereby the last call clicking to ANY_BUTTON will not be intercepted by any RequestGuard.
It brings simplicity to quite hard-to-understand topic.
Together with guarding the request type done, there is also the possibility to wait until the page will catch the given request type, ignoring all other requests.
For this purpose, you can again use Graphene Utility, similary to previous sample:
This is useful in cases, where you expect that also other request can be done.
For example you are relocating to new URL, but on the current page is still active using AJAX (triggering XMLHttpRequest).