The floating tab bar indeed doesn't respond to .tabBars.
Checking is the code is being run on iPad with ipadOS 18, and using .buttons instead, worked for me, e.g.:
var iOS18available = false
if #available(iOS 18, *) { iOS18available = true }
let isIPadIOS18 = iOS18available && UIDevice.current.model.lowercased().contains("ipad")
let firstTab = isIPadIOS18 ? app.buttons["First tab button title"] : app.tabBars.buttons.element(boundBy: 0)
firstTab.tap()
Also see: https://developer.apple.com/forums/thread/759960
Topic:
UI Frameworks
SubTopic:
UIKit
Tags: