18 January 2026:


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.

Find all occurance of String in page

vikkyjainvikkyjain Members
edited November -1 in Sahi - Open Source
Hi,

On my page, I want to search particular String by regex expression, I tried this using javascript and its working fine for me, but when i use similar approach using sahi script, it gives me null.

Please find below the code :

<html>
<body>

<script>

var str=document.body.innerHTML;
var patt=/a/g;
var result=str.match(patt);
document.write("Returned value: " + result);

</script>
</body>
</html>

when i execute this code , it returns me all occurances of a. How i can get this using sahi .
Sign In or Register to comment.