18 January 2026:
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
This forum is now archived and is in read-only mode. Please continue discussions on our improved new Sahi Pro Community forum.
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
Regex question
I need to assert that a div is visible on a page - I am using the following code:
_assert(_isVisible(_div("/\\^Basic Information/"))); because there are two areas on the page with "Basic Information" in them. The navbar which has other links as well as the words "Basic Information" and the div which exists by itself. If I remove the regex altogether then it asserts on the navbar (I can tell because I have it highlighting as well). But with the regex it fails and says "TypeError: Unable to get property 'style' of undefined or null reference"
Any suggestions?
_assert(_isVisible(_div("/\\^Basic Information/"))); because there are two areas on the page with "Basic Information" in them. The navbar which has other links as well as the words "Basic Information" and the div which exists by itself. If I remove the regex altogether then it asserts on the navbar (I can tell because I have it highlighting as well). But with the regex it fails and says "TypeError: Unable to get property 'style' of undefined or null reference"
Any suggestions?
Answers
_setStrictVisibility(true)
_assert(_isVisible(_div("/\\^Basic Information/")));
_setStrictVisibility(false)