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 to locate the elements, when the page is dynamic?
Hi,
Below are the list of issues I am facing with:
1) After executing a testcase, which saves a record, when I execute the sahi script for the second time, and I try to locate the element, using the _near(_div("name")), used in the first occasion, sahi is not able to locate the element for the second time, in the currently active window, because the saved record is getting displayed in the grid, in the main page, thereby making the current div, _div("name") as _div("name[1]")
If I want to locate an element, based on its max node or something, I am not able to do, for ex:
there are two nodes and rather than locating element, by _div("name[1]"), each time, I want to locate it by _div("name[max]"), I am not sure, I would be able to do it.
2) Sahi, what it does, in case, its looking for _div("name"), but not able to locate in the current active window, because of change in div to _div("name[1]")..It executes the script, and gives the test case as, pass, even though the 'save' button, which it has to click is disabled...I included 'wait' statement...which is of less use...
3)keyPress event, which happened successfully, up until now for 'Enter' , in textbox, have for rather unknown reasons, is not happening at the moment, and not able to filter...
4) When I try to locate an element, with div("000000"), sahi has decided to locate an element, which has something like, div("00030200"), I am not sure, what prompted it to do that...
If you could look into these issues, it will be helpful!
Thanks,
Mani
Below are the list of issues I am facing with:
1) After executing a testcase, which saves a record, when I execute the sahi script for the second time, and I try to locate the element, using the _near(_div("name")), used in the first occasion, sahi is not able to locate the element for the second time, in the currently active window, because the saved record is getting displayed in the grid, in the main page, thereby making the current div, _div("name") as _div("name[1]")
If I want to locate an element, based on its max node or something, I am not able to do, for ex:
there are two nodes and rather than locating element, by _div("name[1]"), each time, I want to locate it by _div("name[max]"), I am not sure, I would be able to do it.
2) Sahi, what it does, in case, its looking for _div("name"), but not able to locate in the current active window, because of change in div to _div("name[1]")..It executes the script, and gives the test case as, pass, even though the 'save' button, which it has to click is disabled...I included 'wait' statement...which is of less use...
3)keyPress event, which happened successfully, up until now for 'Enter' , in textbox, have for rather unknown reasons, is not happening at the moment, and not able to filter...
4) When I try to locate an element, with div("000000"), sahi has decided to locate an element, which has something like, div("00030200"), I am not sure, what prompted it to do that...
If you could look into these issues, it will be helpful!
Thanks,
Mani
Comments
I am too facing issue 3.
have u resolved the issue
if yes, den do revert
var $max = document.querySelectorAll('.classname').length;
--> working fine for keypress with enter