18 January 2026:


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.

Common file or i.e. _include file for other scripts

joymac1000joymac1000 Members
edited February 2014 in Sahi Pro
I am trying to setup a common.sah file that will basically login each of my scripts. That way I can manage one file when updating login information. How is best way to go about doing this?

Thanks,

Answers

  • Hi joymac100

    there are different approches like execution in the includefile
    //file1.sah:
    _click("login");
    
    //file2.sah
    _include("file1.sah")
    
    whereas I prefer the Page Object Pattern (http://sahi.co.in/forums/discussion/comment/14246)
    //loginPage.js
    $LoginPage = new Page();
    $LoginPage.prototype.login = function () {
      _click("login");
    }
    
    //test.sah
    _include("allPages.js")
    $LoginPage.login()
    
Sign In or Register to comment.