We are using SAHI to do some benchmark tests. Currently they are collecting some times while exercising the application. These times are stored in a text file. We now have an app to collect and analyze this data. We have a restful API in .Net MVC 4. We created a javascript API thinking SAHI should be able to call the javascript methods and go on its merry way. We are having problems figuring out how to get SAHI to use JQuery properly and reference the API.
Javascript API Object:
;
var BenchmarkService = (function (options) {
var settings = $.extend({
serverName: "http://localhost"
}, options || {});
// public api
this.Benchmark = function (benchmarkName) {
var benchmark;
$.ajax({
type: "GET",
url: settings.serverName + '/BenchmarkServices/Services/Benchmark/' + benchmarkName,
contentType: "application/json; charset=utf-8",
dataType: "json",
async: false,
success: function (data) {
benchmark = data;
}
}
);
return benchmark;
};
this.SaveBenchmarkResult = function (benchmarkResultObject) {
var id;
var url = settings.serverName + '/BenchmarkServices/Services/SaveBenchmarkResult';
$.ajax({
type: "POST",
url: url,
data: JSON.stringify(benchmarkResultObject),
async: false,
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (data) { id = data; }
});
return id;};
}
);
We would like be be able to call these methods within SAHI simply by referencing the .js file.
Is this possible?