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.

Click an item from a div

opeth_huropeth_hur Members
edited May 2014 in Sahi Pro
Hi, I tried this problem with Sahi Open Source (35 & 44) and Sahi Pro.Lets see the problem :

I want to click a div when div isVisible==true. I tried synchronization point but I can't click it. I choose an item from a combobox. And after that page is loading for new items which are want to click. My code is :

• First trial :

if(_textbox("searchName").innerText != null)
{
if(_div("Bireysel Esnaf Kampanyası"))
{
_click(_div("Bireysel Esnaf Kampanyası"));
}
}

• Second trial :

_wait(5000, !_isVisible(_div("Bireysel Esnaf Kampanyası")));
or
_wait(5000, _getText(_div("Bireysel Esnaf Kampanyası"))!="");

(I tried both of them)

_click(_div("Bireysel Esnaf Kampanyası"));

Same problem another screen and my code (It's not working)

• First trial :

if(_div("/x-grid3/").innerText != null)
{
if(_div("Ekonomik Paket"))
{
_click(_div("Ekonomik Paket"));
}

}

• Second trial :

_click(_image("s.gif[12]"));
_keyPress(_textbox(""), 13);

_click(_div("/x-tool-toggle/" , _near(_span("Yeni Seçenekler"))));
_wait(2000);
if(_checkbox("cbxOption").checked == false)
{
_click(_checkbox("cbxOption"));
}

if(_div("/x-grid3/").innerText != null)
{
if(_div("Ekonomik Paket"))
{
_click(_div("Ekonomik Paket"));
}
}

I close the solution with "Second trial" but after the page load, It's not working.

Please help.

Answers

  • as you are using regular expresion /x-grid3/ to identify the div, pleae try by setting strictvisibility to true setStrictVisibility(true)
  • I solved it two days a go but not using the RE.

    Thanks foryour comment.
Sign In or Register to comment.