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.
_Keypress to the end of the page
Hi all,
I've a problem, i use key press enter on a textbox and it works fine
_keyPress(_textbox("" , _under(_div("editableLabel-label"))), [13,13]); <== OK
but now i want to go at the end a page. i found the element, i click it but when i want to press "end" : nothing happens. (_keyPress(_div("newsDoc-content-new"), [79,79]);)
maybe it's not the right code, Maybe it is not the right method...
It is right to use keypress for this action ?
Where can i find codes for _keypress() of sahi?
Thx
Regard
Fabrice
I've a problem, i use key press enter on a textbox and it works fine
_keyPress(_textbox("" , _under(_div("editableLabel-label"))), [13,13]); <== OK
but now i want to go at the end a page. i found the element, i click it but when i want to press "end" : nothing happens. (_keyPress(_div("newsDoc-content-new"), [79,79]);)
maybe it's not the right code, Maybe it is not the right method...
It is right to use keypress for this action ?
Where can i find codes for _keypress() of sahi?
Thx
Regard
Fabrice
This discussion has been closed.
Comments
to update my message, i tried http://sahi.co.in/demo/eventSequence.htm, and i found the code : it's 35. But it still not work with keypress
Thank you
Fabrice
_keyPress(_textbox("" , _under(_div("editableLabel-label"))), [13,13]); <== OK worked because an event is attached to the textbox.
You can perform keyPress on _div("newsDoc-content-new") only if an event is attached to it.
To find more examples you can navigate to <sahi-home>/userdata/scripts/demo/keyPress.sah.
Regards
Sumitra
Thanks for your answer. In keyPress.sah, all examples are plugged on a textbox, that is to say with an event.
My actual problem is simulate a keypress (in my case "end") on a simple page, without event.
How can i do that in Sahi ?
Thank you
Fabrice
Since "end" on a simple page is without an event, its not possible to do keyPress on it.
Regards
Sumitra
HARG.... thank you
Any idea to realise this action ? another method than Keypress, maybe
I've a _div with scroll vertical bar, and when it opens i'm on the top of it : i just want to go at the end of it...
Thank you
Fabrice
You can use:
OR
You can use:
_call(window.scrollTo(0, 1200));
Regards
Sumitra
thank you so
Fabrice
Sorry for the delay, i tried _call(window.scrollTo(0, 1200)); : it works on lot of page, but i give you a site (site of my company) where i can't go at the end of the page
if you have an idea... Thank you so
_call(_div("txt_rubrique_scroll").scrollTop = _div("txt_rubrique_scroll").scrollHeight);
to scroll down non window objects.
Regards,
Narayan
Thank you so ... it works
regards
Fabrice