Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, windows and java based applications. Get your 30 day free trial.

Discuss your Sahi Pro usage patterns, best practices, problems and solutions. Help others solve their problems and seek help from the community when needed. If you need specific support on your application, please email support @ sahipro.com

SAHI - WebSite Search Function + Change to separate WebSite Folder

Hi guys,

I´m looking to get some help to fulfill an automatic search through different tabs or pages of a web based system.
The system listed e.g. 50 products .. but only 10 products per tab / page

I´m wondering if there exist a search function e.g. search for "product 0815" on page 1 .. and if result = 0 / false .. pleae go to page 2 .. and so on > finally a kind of a loop

May somebody could help me in that case

Thanks in advance

Marcel

Comments

  • Solved for my own ;)


    // *** Start - DeAssignment ***

    function doAddDeAssignment($Member, $ProductGroup){

    // Überprüfung eines bestehenden Settlement Members

    _setValue(_textbox(1), $Member);
    _click(_imageSubmitButton("search"));
    _assertExists(_cell($Member));
    _assert(_isVisible(_cell($Member)));
    _click(_cell($Member));

    // Produktgruppe auswählen und deaktivieren

    _click(_span("Product Group"));

    $span = 1;
    while ($span++ < 25) {

    if(_isVisible(_div(""+$ProductGroup+"")))
    //if(_isVisible(_div("EEX_ST_NATGAS_NCG")))
    {
    _doubleClick(_div(""+$ProductGroup+""));
    //_doubleClick(_div("EEX_ST_NATGAS_NCG"));
    _click(_imageSubmitButton("Edit Settlement Member Product Group"));
    _setValue(_textbox("tabs:panel:masterdataAdditionalPanel:validTo:date"), "31.10.2021");
    _setValue(_textbox("tabs:panel:masterdataAdditionalPanel:validTo:time"), "00:00:00");
    _click(_imageSubmitButton("Save Settlement Member Product Group"));
    $span = 25
    }
    else

    _click(_span(""+$span+""));

    }
    }

    // Einlesen EXCEL

    _log("001");

    var $data = _readExcelFile("THE_TEST_DeAssignment.xlsx", "MasterData",false);

    _log("002");

    if($data!=null) {

       // Maske Settlement Member öffnen
       _assertExists(_link("MMS"));
       _assert(_isVisible(_link("MMS")));
       _click(_link("Settlement Members"));
    
       _dataDrive(doAddDeAssignment, $data);
    

    }

    // *** ENDE ***

Sign In or Register to comment.