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.

Sahi sensitivity to GUI changes

gpiogpio Members
edited November -1 in Sahi - Open Source
Hi all,

I am searching for a platform for regression functional testing on our Web application server.
Since the pages are still under continuous development I am searching for a record play gui testing platform which has no sensitivity to this changes. For example in the login screen there is always a "submit" button but his position(in the DOM) may change ..

During recording Sahi how sensitive is it?
It always searches for the desired objects dynamically (using some property: id, name etc) ?

Thx in advance
george

Comments

  • Hi,

    As long as the unique property (ID, name etc.) of the element is not changing, you can rest assured that sahi will identify it comfortably no matter where it is positioned (in the DOM).

    Regards,
    Pankaj
  • gpiogpio Members
    Thx for the quick answer.

    Can I configure sahi to recognize objects ony by one or two attributes (name and/or id)
    Also is it possible to store these attributes in an external file making my tests dynamic adjustable in GUI changes ?
  • Hi,

    I am not sure if I got you correctly, if you want to store the IDs of the elements in a separate file and then use them in your sahi script you can do it using a simple text file (use _readFile() in this case to retrieve the values) and use them in your sahi script.
    OR
    you can use excel sheet to store the values and use DB queries to fetch the required values.

    Please correct me and send further details about your requirements. Will try to send you some example for that.

    Regards,
    Pankaj
  • gpiogpio Members
    Hi Pankaj,

    I have two requirements for my GUI testing platform:

    1) During recording all recorded objects, should be at runtime dynamically found in the web page by some unique attribute (s) {id and/or name}

    2) in order to be fully data driven all these attributes should be stored externally (DB, xls etc), so if the developers change them the scripts should remain unaffected.

    Hope everything is more clear now.

    Geogre
  • Hi,

    You can use simple text files or excel files as I have mentioned earlier but I am not sure how efficient that approach would be. I mean reading from the file for every web element that you want to perform some action on and using that retrieved id(unique attribute) to perform the required action. It would reduce the speed alot, I suppose.

    However, you can just use an excel sheet in that case with the element id and some other things that help identify that particular element like the page name where it occurs.
    Then fire a query to fetch the required element id from the sheet. You would need to design a framework around that.
    I havnt tried anything like that yet, but can try my hands on it this weekend if you need. :)

    All the best!
    Pankaj
  • pankaj.nithpankaj.nith Members
    edited July 2009
    Hi,

    I have this rather very small example here. I hope it helps you a bit.
    //_navigateTo("www.google.co.in");
    var $rs = new Array();
    $rs[0]=[];
    var db = _getDB("sun.jdbc.odbc.JdbcOdbcDriver", "jdbc:odbc:Driver={Microsoft Excel Driver (*.xls)};DBQ=C:\\sahi\\input\\google.xls;readOnly=false", "", "");
    $rs = db.select("select ID from [Sheet1$] where page='home' AND Type='textbox'");
    _setValue(_textbox($rs[0]["ID"]), "sahi");//using the ID returned by query
    $rs = db.select("select ID from [Sheet1$] where page='home' AND Type='submitButton'");
    _click(_submit($rs[0]["ID"]));//using the ID returned by query
    
    I have commented _navigateTo() part as it is not working for me.
    navigate to www.google.co.in manually and invoke the sahi controller
    then set the script and click play.
    You will need the following data in excel sheet at appropriate path
    Page    Type                 ID
    home    textbox               q
    home    submitButton       Google Search
    
    Send me a mail if you need these demo scripts.

    Regards,
    Pankaj
  • gpiogpio Members
    edited July 2009
    That could be great.!!!!

    Concerning the sensitivity issue I was reffering to this limitation of Rational Functional Tester.

    ibm.com / developerworks/forums/thread.jspa?messageID=14150800
Sign In or Register to comment.