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.
Dom access API's
i used this API
_byClassName("className", "div")
this should fetch me all the div's with className in argument
but instead of returning array it returns only one element.
is there any API that returns array of HTMLObjects?
_byClassName("className", "div")
this should fetch me all the div's with className in argument
but instead of returning array it returns only one element.
is there any API that returns array of HTMLObjects?
Comments
i want to use jQuery inside sahi how do i do that??
If you can give us an example of how you would like to use it, we can show how to do it.
Regards,
Narayan
Kindly check these links:
http://sahi.co.in/forums/viewtopic.php?id=1811
Let me know if this helps you.
Regards
Sumitra
while some sets are unique to specific div's
i want to write a sahi script which allow's me to do a bulk operations on all the div's
like we do in jQuery
example
var allDiv = $("div.commonClass");
var typeA = allDiv.filter(filterOnSomeCustomLogic());
var typeB = allDiv.filter(filterOnSomeCustomLogic_B());
so i need a way to write jquery code in my.sah file
if a developer has to tests its HTML + Javascript component
then sahi should allow using jquery(or any other library) to create some testing abstractions(Dom validation API's) for their own components.
Narayan it would be really cool to write complete sahi script in jquery.
You can write your javascript functions around jquery, put it in <browser> tags and call them anywhere using Sahi.
Eg.
That said, you raised the correct question. Automation testers should NOT use libraries that developers use. Use the above only if you are aware that you are trying to test a JS component. Writing scripts in jquery is actually a bad idea. You will never be able to test if the actual applications behaves correctly, because you may be using the same buggy framework that the developer was using.
Regards,
Narayan