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.
Checking the active tab
Hi!
I'm having problems to find out if the tab is active or no. In the web page there is 4-5 different tabs.
Here's the part of the element of tab, where it's mentioned if it is active.
<section ng-controller="BasicInformationCtrl" class="ng-scope active" style="padding-top: 49px;">
My problem is that how I can get that information out so that I can use them in my verifications?
I'm using Sahi Java driver.
I'm having problems to find out if the tab is active or no. In the web page there is 4-5 different tabs.
Here's the part of the element of tab, where it's mentioned if it is active.
<section ng-controller="BasicInformationCtrl" class="ng-scope active" style="padding-top: 49px;">
My problem is that how I can get that information out so that I can use them in my verifications?
I'm using Sahi Java driver.
Best Answers
-
Hi
$tabs = _collect( "_div", "/./", _in($navBar)); for $element in $tabs if $element.class.indexOf("active") then return element
Just pseudocode, but I hope it gives you the right directions.
Regards
Wormi -
Here's the solution I finally used to check which tab is active.
The first tab was the trickiest because it didn't have any ID. So I decided to check if some information existing only on that tab is visible.
browser.heading6("Unique title").isVisible()
For the rest of the tabs case was easier because I noticed they have ID. so basically checking was following:
browser.byId("Unique ID of tab").fetch("className").contains("active")

Answers
Only thing is that with Sahi java driver there is no _collect available. The closest method is collectSimilar(). Now I have to study if that is able to do the same trick.