18 January 2026:
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
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.
How can i use Click Events on Elements only shown while MouseOver
Hi,
how can i run a click event on an element, that is just shown on mouseover on an image?
If i mouseover on an image then a new element appears for editing the image.
So if i click on the Edit element, a new "div" is visible with the possibility to add an image (browse on location).
I tried this:
...
// create new contact
click(_div("Add a contact"));
_wait(2000);
// mouseOver the defaultimage; now a "edit Image"-Element is visible
_mouseOver(_image("<get image for contact call>"));
// click on the "edit Image" Element
// this should open new elements for browsing a computer, but do not
_click(_div("icon"));
// click on this Element to locate an image
_click(_link("tab_fileLink"));
...
and this:
...
click(_div("Add a contact"));
while (_condition(_mouseOver(_image("<get image for contact call>")) == true)){
_click(_div("icon"));
}
_click(_link("tab_fileLink"));
But both solutions do not work, because Sahi can't find the element "_link("tab_fileLink")".
I watched the test and it worked until the mouseOver event.
Any feedback / tips ?
Regards, Vall0n
how can i run a click event on an element, that is just shown on mouseover on an image?
If i mouseover on an image then a new element appears for editing the image.
So if i click on the Edit element, a new "div" is visible with the possibility to add an image (browse on location).
I tried this:
...
// create new contact
click(_div("Add a contact"));
_wait(2000);
// mouseOver the defaultimage; now a "edit Image"-Element is visible
_mouseOver(_image("<get image for contact call>"));
// click on the "edit Image" Element
// this should open new elements for browsing a computer, but do not
_click(_div("icon"));
// click on this Element to locate an image
_click(_link("tab_fileLink"));
...
and this:
...
click(_div("Add a contact"));
while (_condition(_mouseOver(_image("<get image for contact call>")) == true)){
_click(_div("icon"));
}
_click(_link("tab_fileLink"));
But both solutions do not work, because Sahi can't find the element "_link("tab_fileLink")".
I watched the test and it worked until the mouseOver event.
Any feedback / tips ?
Regards, Vall0n
Comments
The Statement "_click(_div("icon"));" shows only a Hint when clicked. I think the reason is, that "_div("icon")" is not as exact as the identifier below.
So with the Statement "_click(_byId("contactDetailEdit_actionbar_action_edit"));" instead of "_click(_div("icon"));", it worked fine.
Regards, Vall0n