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.

Unable to click on rect element from the Chart

vinothtvinotht Members
edited July 2013 in Sahi Pro
The following code was used to identify the object and to hightlight and it worked successfully:
var $Ele =_div("/ChartContainer.*[0]/").getElementsByTagName("rect")[6];
_highlight($Ele);

I used all the following combination to click on the rect object which was able to hightlight but click operation is not happening on the same.

_focus($Ele);
_simulateMouseEvent($Ele, "mousedown",false,true,"CTRL");
_simulateMouseEvent($Ele, "mouseup");
_mouseOver($Ele);
_mouseDown($Ele);
_mouseOver($Ele);
_mouseUp($Ele);
_focus($Ele);
_click($Ele);
$Ele.dblClick;
_keyPress($Ele, " ");
_keyPress($Ele, [13,0]);

Browser: Chrome
Sahi Version: 4.5.2
Please suggest is there any other method to click on the rect element

Best Answer

  • Answer ✓
    I got the solutions:
    A. I used 5.0.5 and the rect objects are identified properly and the click event works successfully.

    B. Moreover, I found the rect index obtained using 5.0.5 was 25 and hence the code which was supplied earlier was not working. Using the same code passed with index 25 it works even with 4.5.2 too.

    working code:
    var $Ele =_div("/ChartContainer.*[0]/").getElementsByTagName("rect")[25];
    _click($Ele);

Answers

  • Hi,
    Please try out using the latest release Sahi Pro version and let me know if it still doesn't work for you.

    Regards.

Sign In or Register to comment.