- Can I assert that an element is not on the page?
- Can I assert against an element that only appears on hover?
- Can I assert against an SVG element?
- Can I assert against CSS properties?
- Can I assert that a page or image has fully loaded?
- Can I assert that the date is the current day?
If you want to assert that an element is on the page, depending on the circumstances, you can take one of the following approaches:
- Work backwards: Create an "is not present" assertion while the element is still on the page. (The assertion will run after being created and fail.) Move the step to the position in your test where you expect it to be absent.
- Use a custom find assertion: If the element doesn't appear during testing, but you can identify it with CSS or XPath, you can record a custom find assertion and select the "is not present" assertion type.
If the element only appears briefly or disappears when you try to record an assertion step, consider trying one of the following workarounds:
- If the tooltip is clickable, record a click step on the tooltip and convert that step into an assertion using assert on element
- If you are familiar with CSS or XPath selectors, you can try creating a custom find assertion.
Currently, mabl cannot interact directly with SVG elements. Depending on what your end goal is, you might consider one of the following workarounds:
- Asserting on the element that contains the SVG element (the parent element).
- If you want to assert on an SVG element's attributes, you can try creating this two-step workaround:
- Make an assertion against the variable value.
If you need a different type of support for SVG assertions, please let us know in the mabl Product Portal.
There is no direct way to assert whether a page or image has fully loaded. If there is an element or element property/attribute in the DOM that consistently indicates that the page/image is fully loaded, it could be used as a workaround to assert "loadedness." Ultimately, it depends on how your page works
Updated 13 days ago