Please note that Sahi's development and support teams do not actively monitor this. This is more a community forum. If you are a Sahi Pro user looking for commercial support, please email support @ sahipro.com with your query.

Sahi Data Driven Example with TestersDesk

edited November -1 in Sahi - Open Source
Folks,

TestersDesk is a nice online tool to generate data for data driven testing.
Have a look at this link to see how one can do datadriven testing using Sahi and TestersDesk

http://sahi.co.in/demo/td/guitar.htm

Regards,
Narayan

Comments

  • Hello Narayan,
    I have gone through testersdesk and guitar, its really nice and have done one simple data driven test for username and password, its working fine. Please review my below code.

    function login($uname,$pwd)
    {
    _setValue(_textbox("uname"), $uname);
    _setValue(_password("pword"), $pwd);
    _click(_imageSubmitButton(0));
    if (_Exists(_image("eliteemail.gif")))
    {
    _click(_image("eliteemail.gif"));
    _click(_image("Contacts"));
    }
    }

    var $data = _readCSVFile("../scripts/TestData/Login.csv");
    for (var $i=0; $i<$data.length; $i++)
    {
    var $row = $data[$i];
    login($row[0], $row[1]);
    }

    The data driven test is working fine, but have an issue with 5th line in function. (i.e. if (_Exists(_image("eliteemail.gif")))), but exists keyword is not working here

    I need to make one if condition and if this image is exists then I need to go in loop and perform some steps and in else part I wanted one simple message box.

    I am doing something wrong with syntax here, could you please guide me how can I perform this operation for data driven test.

    also it would be great help if you could provide me any word or pdf file for syntex using in sahi.

    Thanks
    Chetan!
  • Chetan,

    _Exists is not a function in Sahi. You can generally check for existence of an element by verifying that it is not null.

    In your case you need
    if (_condition(_image("eliteemail.gif") != null)){
      _click(_image("eliteemail.gif"));
      _click(_image("Contacts"));
    }
    
  • Thanks a lot Narayan!!

    It's working fine and now i am able to get something in this tool. I am exploring this tool i will come to you if i have any issue.

    Thanks with Regards,
    Chetan!
  • edited September 2009
    Hi Chetan,

    I thank Narayan for posting this-

    Please take a moment in reading the below-

    TestersDesk.com is more useful when you want to test all "decisions" or "combinations" of values where each test parameter (a.k.a factor or variable).

    Take the below input model with three test parameters-


    day:sunday,monday,tuesday,wednesday,thursday,friday,saturday
    month:jan,feb,march,april,may,june,july,august,sep,oct,nov,dec
    year:2008,2009,2010,2050


    Now, there are two paths you can choose in testing this- one you may want to test all the combinations of these three parameters assuming that each set has a different outcome, making it a total of 7 values of day * 12 values of month * 4 values of year = 336 test combinations). For this you would use our "N-way Test Case Generator" from the Test Design Toolkit.
    Second, in cases where you are compounded with multiple independent test parameters each with multiple values each, you might end up in a large total. Take the below example-


    Journey mode: Return trip, One way
    Preferred time: Morning, Afternoon, Evening, Late night
    Leaving from: Type1_City,Type2_City,Type3_City
    Going to: Type1_City,Type2_City,Type3_City
    Booking type: Economy, First class
    Customer type: Registered, New
    Adults: 1, 2, 3, 4, 5, 6
    Children: 0, 1, 2, 3, 4


    We have a total of 8640 test combinations here (2 * 4 * 3 * 3 * 2 * 2 * 6 * 5). Here, if you dont want to test all the N-way combinations you can judiciously rely on our "Pairwise Test Case Generator" that covers all 2-way interactions (pairs) of test parameters in the least possible test cases. Check the above and you will find that we cover all the interactions just in 31 test cases. This will achieve reasonable coverage as you can research/pilot.

    Again, these CSV charts we produce have to be only one aspect of your testing and it is the human tester who always adds more tests based on their orientation power towards the application under test.

    To re-iterate,

    You use N-way Test Case Generator where you are sure that each combination has a different outcome that you need to individually verify

    You use Pairwise Test Case Generator when you want a reduced test set that at-least covers all the interactions in a 2-way coverage.

    By the way, from automation standpoint, whether you use N-way or Pairiwse, you dont load them with all the fields in a test transaction and use only functionally impacting ones. Say a screen has 25 fields, and that only 6 fields from it matter, you would hardcode/randomize values for 19 of them in your script, and parameterize/data-drive the important 6 fields from the CSV output generated by http://www.TestersDesk.com.

    Cheers,
    Ashwin.

    Ashwin Palaparthi,
    Founder, ValueMinds.
    http://www.TestersDesk.com - Better Test Design. Faster Test Data.
  • Hi ashwinp,

    I have gone through it and it's really nice and interesting test areas where we can save a time, test proper functionality and use this things in multiple ways.

    Thanks a lot for your kindly support and information.

    With the Best Regards,
    Chetan!
This discussion has been closed.