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.

HTML Text Editor

ChaitanyaChaitanya Members
edited October 2013 in Sahi - Open Source
How to deal with HTML text editor.

Best Answer

  • Hi Chaitanya,
    I am assuming you are looking for help with rich text editor.
    If yes, please have a look at the following info.
    Identification:
    _rte($identifier[, $relation ...])
    
    Arguments:
    $identifier:	string - Can be name, id or index of iframe which houses the RTE.
    $relation - relation optional	 Relation APIs
    
    Details:
    _rte("editor") // using id
    _rte(0, _in(_div("editorDiv"))) // using index and _in
    _rte is the same as _iframe.
    
    RTE Fetch APIS:
    _rteText($el)
    
    Arguments:
    $el : HTML DOM element -	Element which is content editable (eg. _rte(0))
    
    Details:
    
    Returns the text inside a rich text editor (without the html formatting) as a string.
    // get the rich text editor's text content
    var $rteText = _rteText(_rte("rteId"));
    // $rteText may look like "Hi there"
    
    _rteHTML($el)
    
    Arguments:
    $el: HTML DOM element - Element which is content editable (eg. _rte(0))
    
    Details:
    
    Returns the HTML content inside a rich text editor (without the html formatting) as a string.
    // get the rich text editor's HTML content
    var $rteHTML = _rteHTML(_rte("rteId"));
    // $rteHTML may look like "Hi <b>there</b>"
    
    RTE Action APIs:
    
    _rteWrite($rte, $html)
    
    Arguments:
    $rte:	HTML DOM element -	RTE to write into
    $html	: string - html to write
    
    Details:
    
    Replaces the content of the RTE with given HTML.
    Note that this does not simulate all events like other Sahi APIs.
    _rteWrite only replaces the content of the iframe.
    _rteWrite(_rte("editor"), "Hi <b>user</b>");
    
    

Answers

Sign In or Register to comment.