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.

Testing the Telerik controls with SAHI

vatsanvatsan Members
edited June 2011 in Sahi - Open Source
i am trying to automate a web application that uses the telerik controls. i'm doing the following steps while recording.

start recording
click a Dropdown ( e.g. City)
Selecting a City from the dropdown ( chennai)
Stopped recording

when i playback the city that i have selected during the recording is not getting displayed. it picks some other city from the dropdown.

please help me.


Thanks!

Comments

  • SumitraSumitra Members
    Hi vatsan,

    What version of Sahi and which browser are you using?

    Can you post the URL and the script?

    Regards
    Sumitra
  • vatsanvatsan Members
    edited June 2011
    Hi Sumitra,

    SAHI version is 3.5

    Browser - IE 8

    _click(_link("Go To Here (vatsan)"));
    _click(_submit("Test"));
    _click(_listItem("Chennai"));
    _setValue(_textbox("ctl00\$MainContent\$rcbCust_type_id"), "Chennai");
    _click(_imageSubmitButton("ctl00\$MainContent\$btnView_top"));
  • vatsanvatsan Members
    But im able to achieve if i use the alternatives as below.

    _click(_link("select[3]"));
    _click(_listItem("Chennai"));
    _click(_imageSubmitButton("ctl00\$MainContent\$btnView_top"));


    I have to test for 10 values ( say, mumbai, bangalore etc..) then i copied the above 3 lines and changed the values and able to get the result.

    But can we able to write a function and put it in a For loop ?
  • SumitraSumitra Members
    Hi vatsan,

    As you can see in your first script, there is a possibility that you might have skipped clicking on the Select box and then you had to select chennai while recording.

    So you had to use the alternatives in the second script.

    Ctrl+Hover on the Chennai and check if index's are been created for it. If index's are been created then you can write a function and put it into a for loop.


    Regards
    Sumitra
  • narayannarayan Administrators
    Hi Vatsan,

    You can put it in a loop. Ex.
    function selectCity($city) { 
      _click(_link("select[3]"));
      _click(_listItem($city));
      _click(_imageSubmitButton("ctl00\$MainContent\$btnView_top"));
    }
    
    var $values = ["Chennai", "Bangalore", "Delhi"];
    
    for (var $i=0; $i<$values.length; $i++) {
      selectCity($values[$i]);
    }
    

    Regards,
    Narayan
  • vatsanvatsan Members
    Excellent!! it works fine now.

    Thank you Narayan and sumitra. i really appreciate for helping me out.

    Will keep disturbing you :-)

    Regards,
    Vatsan
This discussion has been closed.