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.

Issue with data input

JaoBrJaoBr Members
edited February 2010 in Sahi - Open Source
Hi everyone.

I'm really new using Sahi, i'm having troubles while I try to test an field lenght.
The field "name" have an max lenght of 50 chars, when I type 50 chars and try to input the next one, the system don't do nothing, it just doesn't insert it (no alerts or message box).
Using Sahi when I try to input 51 chars, Sahi "makes the system" accept this, instead of only inputing 50 chars.
After this I use an assertion to make sure that the text was not inserted, but always fail:
function test(){
    var $text;
    $text = "abcdefghijlmnopqrstuvxzabcdefghijlmnopqrstuvxzabcd1";
    
    _popup("mysystem")._setValue(_textbox("name"), $text);
    _popup("mysystem")._assertNotEqual($text, _textbox("name").value);  
 }

Also, I tried to use the _type API, but i even don't know if its right:
function test(){
    var $text;
    $text = "abcdefghijlmnopqrstuvxzabcdefghijlmnopqrstuvxzabcd1";
    
    _popup("mysystem")._setValue(_textbox("name"), $text);
    _popup("mysystem")._assertNotEqual($text, _textbox("name").value);

    _popup("mysystem")._setValue(_textbox("name"), "");    
    _popup("mysystem")._focus(_textbox("name"));
    _popup("mysystem")._type(_textbox("name"), $text);
    _popup("mysystem")._assertEqual($text, _textbox("name").value);  
 }

I used just "equal" instead of "notequal" cause with the _type API I can't insert the data.
Using the Sahi Controller with only the _type API, it shows the message "undefinied".

Can someone help me?

Comments

  • JaoBrJaoBr Members
    No one? =/
  • narayannarayan Administrators
    JaoBr,

    Sahi did not have check for maxlength as of the last release. We are making a release tomorrow, which will have support for maxlength checks. Your initial test function should work then.

    Regards,
    Narayan
  • narayannarayan Administrators
    JaoBr,

    You can use the 20100302 release on SourceForge and check if the maxlength limit works correctly.

    Regards,
    Narayan
  • JaoBrJaoBr Members
    Thanks narayan!!! :D
    It works fine now :)
Sign In or Register to comment.