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.
MouseOverTexte
Hi Everybody
I know that there is the possiblity to simulate a mouse over event in sahi, during replay I can see the mouse hovering over the given element and a mouseovertext is shown - my question is how to verify these text :-). Is there any possibility?
Thanks for help
Best regards
I know that there is the possiblity to simulate a mouse over event in sahi, during replay I can see the mouse hovering over the given element and a mouseovertext is shown - my question is how to verify these text :-). Is there any possibility?
Thanks for help
Best regards
Comments
If the mouseover text is via javascript, you will have to find out what div or span is being displayed and then assert its contents.
first it is an image, I can simulate a mouseover event: _mouseOver(_image(51)) - but I can't verify the text (that is correctly shown in the Browserwindow).
The text comes via javascript, I can call the function:
_image(51).onmouseover or _call(__image(51).onmouseover)
I get the result ((via the sahi [test-->] button )):
function anonymous()
{
/*********some mousover text ; D ********//
}
How can I verify this text ?!?!?the text itself don't seems to be a element so I think _div(???) and _span (????) don't work....
_spandiv will kind of look for any span or div with the given text. Use a regular expression if that does not work. eg. _spandiv(/text_on_.*/).
It may happen that the span/div was always on the page but not visible. In that case, _assertNotNull(_spandiv('text_on_mouseover')) will return true even before the mouse over. In that case, use or depending on which works.
What we are checking for is similar to _spandiv('text_on_mouseover').style.display == 'block' or 'inline'
If it is possible, send a snippet of the html code.
first thanks for this input - the frist snipet of code doesn't work in my case
now I have tested the following:
_assertEqual(/.*my_mouse_over_text'.*/,_image(51).outerHTML);
but the assertion fails , it looks like as if the reg expr is not handled correct.
On the controller, evaluate _image(51).alt or _image(51).title and see what you get.
If you do not get the desired text, post some html here.
outerHTML is not supported on all browsers.
I also need to use regular expressions in assertions. Any help will be great
Regards,
Pankaj.
Please comment on the code below and let me know where i am wrong...
var $aA = top.document.getElementsByTagName('span')[132];
var $aAVal = parseInt($aA.getAttribute("innerText"));
var $text = "xyz" + $aAVal + "abc";
_assertContainsTextNew($text, _byId("id_xyz"));
when i run this code through the script it gives error: undefined object.
but if i run the same in the sahi controller (Evaluate Expression) it works fine.
What I need to do is as follows:
A particular number(string value) appears as a link on the page and I first need to convert the number to integer value and pass it to a variable which i want to use in an assertion.
Any workarounds will be a great help.
Regards,
Pankaj.
Do this:
Please read up on these links, to understand how to write scripts in Sahi:
http://sahi.co.in/w/sahi-script-and-javascript
http://sahi.co.in/w/Script/
Btw, what is _assertContainsTextNew? Is it a scheduler function you have added?
The _assertContainsTextNew() is similar to assertContainsText(). Was trying to return the desired value.
Regards,
Pankaj.