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.
Asserting an ElementStub is present / not present
OS Name: Windows 7
Browser Name and version: Firefox 3, Chrome
Sahi Build (Available on Sahi controller's Info tab): 3.5
I need to assert that some table data is not present or present (depending on the state of the web application). In my first approach the key to this is the following method, that returns the row or (if it isn't present) null. The strings in capital letters (for example ACTIVITY) are constants that are always filled. The problem with this is:
- If the row is present I get the result very fast: Ok
- If the row is not present it seems that Sahi waits for a very long time. Does this have to do with the implicit waits? Do you know a way to avoid this? It doubles the testing time which is a problem.
Thanks in advance
Java code snippet:
Browser Name and version: Firefox 3, Chrome
Sahi Build (Available on Sahi controller's Info tab): 3.5
I need to assert that some table data is not present or present (depending on the state of the web application). In my first approach the key to this is the following method, that returns the row or (if it isn't present) null. The strings in capital letters (for example ACTIVITY) are constants that are always filled. The problem with this is:
- If the row is present I get the result very fast: Ok
- If the row is not present it seems that Sahi waits for a very long time. Does this have to do with the implicit waits? Do you know a way to avoid this? It doubles the testing time which is a problem.
Thanks in advance
Java code snippet:
public ElementStub getActivityRow() {
ElementStub projectRow = browser.parentRow(browser.cell(ACTIVITY_PROJECT));
if (projectRow != null) {
if (browser.cell(ACTIVITY_PHASE).in(projectRow).exists()
&& browser.cell(ACTIVITY).in(projectRow).exists()
&& browser.cell(ACTIVITY_REMARK).in(projectRow).exists()
&& browser.cell(ACTIVITY_DURATION).in(projectRow).exists()) {
return projectRow;
}
}
return null;
}