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.

Passing object name from DB MySQL

facilosfacilos Members
edited November -1 in Sahi - Open Source
hi,

windows 7
chrome
sahi OS 3.5

This problem had already been published in "Passing object name from Excel sheet" but no answer.

Is stored in an object name in the database. By querying the name of the object that it returns with quotes. How do I remove the double quotes?

$ var obj = $ object ["Obj_Objeto"];/ / the recordset returned from the database _textbox (0)
_setValue ($ obj, "Hello");

the result is:

_navigateTo ("sahi.co.in/demo/training/login.ht");
_setValue ("_textbox (0)", "Hello");
- Stopped Playback: FAILURE -

The log says:

Starting script
_navigateTo ("sahi.co.in/demo/training/login.ht") at 09-Aug-2012 9:26:47
_debug ("End") at 09-Aug-2012 9:26:47
Logging exception:
_setValue ("_textbox (0)", "Hello");
TypeError: Can not call method 'CreateEvent' of undefined
TypeError: Can not call method 'CreateEvent' of undefined
unknown source at
Click for browser script at 09-Aug-2012 9:26:57
_debug ("End") at 09-Aug-2012 9:26:59
stopping script

Please help.

Oscar C.
Thank you.

Comments

  • ashokashok Members
    use substr function to get the required string.

    here is the example

    var str="Hello world!";
    var n=str.substr(2,3)

    this will return : llo
  • Thank you very much for your reply,

    The problem is that the content of the variable n string and continues to be such a variable is not recognized by the engine SAHI.

    The problem is that _textbox (0) to be an object identifier can not string if no object.

    Judgment misguided:

    _setValue ("_textbox (0)", "Hello");

    Correct sentence:

    _setValue (_textbox (0), "Hello");

    Note that the correct judgment is without double quotes.

    Returning the object name of the database, it returns as a string and requires that this be SAHI object type without quotes.

    And found a solution but this is not optimal.


    Thank you very much for your help.
Sign In or Register to comment.