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.
way to identify only by class name?
I couldn't figure out a way to identify a node simply by class name. If there is a better way, please post some feedback.
I don't care if it is a div or a span, but if there is something on the page with a specific class name, the best solution I found was to use jquery:
_getText($(".className"))
Again, if there is a better way in sahi script, please update this post
I want something to the effect of
_node("classname")
I don't care if it is a div or a span, but if there is something on the page with a specific class name, the best solution I found was to use jquery:
_getText($(".className"))
Again, if there is a better way in sahi script, please update this post
I want something to the effect of
_node("classname")
Answers
"$" is not defined
so I wrote this as the alternative:
if(_exists(_div("class"))){
var $observedText = _getText(_div("class"));
}else if(_exists(_span("class"))){
var $observedText = _getText(_span("class"));
}else{
etc.