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.
get all links of current page from Ruby client
hello
I'm writing a client ruby which need to get all links in the current web page.
which solution is the more efficient ?
1-execute a javascript function embedded automatically with inject_top file : which methode apply ?
-method_missing
-execute step
- ....
2-parse webpage from outside page with elementStub ?
-i'm logging for a sample of using ElementStub, because i don't undertand the third parameter
3-an another solution ?????
Thanks to read me.
Thanks a lot for help.
Dave
I'm writing a client ruby which need to get all links in the current web page.
which solution is the more efficient ?
1-execute a javascript function embedded automatically with inject_top file : which methode apply ?
-method_missing
-execute step
- ....
2-parse webpage from outside page with elementStub ?
-i'm logging for a sample of using ElementStub, because i don't undertand the third parameter
3-an another solution ?????
Thanks to read me.
Thanks a lot for help.
Dave
Answers
I choose to use fetch to execute a function javascript.
my function is include in sahi/htdocs/spr/extensions.js in object Sahi.
If i don't do this fetch from ruby fail.
second step : i try inject dynamically this code with browser_JS ; call to my function failed.
my function is unknowned.
even, if is use "return document.links[0]", i had got the same error.
i saw none response in the forum which explain how to succeed to make this call : in java or ruby
what a pity
Thanks to read me.
Thanks a lot for help.
Dave