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.
Reading of javascript from page
Hi,
I would like to ask if is it possible to get values from javascript of tested page by using Java.
Example:
Following code of javascript is on the tested page.
...
function(){
var cities = ["Prague","London", "Paris"];
}
...
and I need to get values from the list by using Java.
Is it any way to do?
Thanks Martin
I would like to ask if is it possible to get values from javascript of tested page by using Java.
Example:
Following code of javascript is on the tested page.
...
function(){
var cities = ["Prague","London", "Paris"];
}
...
and I need to get values from the list by using Java.
Is it any way to do?
Thanks Martin
Comments
Does this function have a name?
You can do
browser.fetch("yourFunction()");
to get a string representation of the array. You can then parse it.
Regards,
Narayan
Thanks,
Martin
Description:
I took the name of method from DOM by Firebug. Inner functions are separated by dot. ("permanentAddress.init")