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.

how to read key-value from a propety file in sahi scripts?

bosshr1043bosshr1043 Members
edited November -1 in Sahi - Open Source
I want to know how do i Externalize the IDs and then read them in my sahi scripts.

I want this because, if the IDs are changed very often,we can change them in property file but th scripts remain same.

An example will help me lot.

Thanks in advance.

Comments

  • narayannarayan Administrators
    Create a file keyValues.sah
    Put your key values like this:

    $nameId = "userName";
    $ageId = "age";

    And then include it as a regular Sahi include using

    // Include this file where ever you want
    _include("keyValues.sah");

    // Access variables normally
    _setValue(_textbox($nameId), "User One");
    _setValue(_textbox($ageId), "56");
Sign In or Register to comment.