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.
match problems
OK, I've looked up and tried to emulate the way wormi has talked about doing pattern matching, but it's not working for me. This is what I have:
var str= document.getElementById('unread_notification_list').innerHTML;
var patt=/You have [0-9]+ leads waiting to be allocated\.[\s]+Click here to open online allocation\./;
var $result=str.match(patt);
_click(_link( $result ));
I was hoping to narrow down by matching a containing div, the unread_notification_list, get the text from that via the pattern match since it's dynamic, and do the link from there.
I have to do a timer, but this works in doc ready:
console.log(document.getElementById('unread_notification_list').innerHTML.match(/You have [0-9]+ leads waiting to be allocated\.[\s]+Click here to open online allocation\./g));
I tried using that straight in the _click command, but that doesn't work either:
_wait(3000); // edit: doing this wait first to wait for stuff to load
_click(_link(document.getElementById('unread_notification_list').innerHTML.match(/You have [0-9]+ leads waiting to be allocated\.[\s]+Click here to open online allocation\./g)));
Any thoughts/help appreciated.
Regards,
Glenn
var str= document.getElementById('unread_notification_list').innerHTML;
var patt=/You have [0-9]+ leads waiting to be allocated\.[\s]+Click here to open online allocation\./;
var $result=str.match(patt);
_click(_link( $result ));
I was hoping to narrow down by matching a containing div, the unread_notification_list, get the text from that via the pattern match since it's dynamic, and do the link from there.
I have to do a timer, but this works in doc ready:
console.log(document.getElementById('unread_notification_list').innerHTML.match(/You have [0-9]+ leads waiting to be allocated\.[\s]+Click here to open online allocation\./g));
I tried using that straight in the _click command, but that doesn't work either:
_wait(3000); // edit: doing this wait first to wait for stuff to load
_click(_link(document.getElementById('unread_notification_list').innerHTML.match(/You have [0-9]+ leads waiting to be allocated\.[\s]+Click here to open online allocation\./g)));
Any thoughts/help appreciated.
Regards,
Glenn