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.
Browser.activeElement() in Java Docs
From the Java Docs of Sahi I found the following method.
activeElement
public ElementStub activeElement(java.lang.Object... args)
Defines the element in focus.
Usage: browser.activeElement()
Example:
assertEquals("username", browser.activeElement().fetch("id"));
Returns:
a stub representing the element
I tried to use it but it wasn't even recognized. Do you know if it should work? I mean if it's some old feature or a coming feature?
activeElement
public ElementStub activeElement(java.lang.Object... args)
Defines the element in focus.
Usage: browser.activeElement()
Example:
assertEquals("username", browser.activeElement().fetch("id"));
Returns:
a stub representing the element
I tried to use it but it wasn't even recognized. Do you know if it should work? I mean if it's some old feature or a coming feature?
Best Answers
-
Hi Sadana,
Can you please tell me which version of Sahi OS are you using?
browser.activeElement() is available in Sahi 4.3 and onwards.
Please let me know if the upgradation resolves your issue.
Regards. -
Hi Sadana,
Please change your Sahi Version to 4.4 which is the latest released Sahi OS version.
It should solve the problem for you.
If you still have any problems using the API, please let me know.
Regards
This discussion has been closed.
Answers
Can you please elaborate what you meant by it wasn't recognized ?
Please send me the HTML for which your are testing.
Regards,
Pratik Shah