0

In the app, I am able to go to Settings and turn on the Dark Mode feature.
I want to check that this feature is working and write a test validating that the app went into Dark Mode successfully.

krisc
  • 95
  • 1
  • 10

1 Answers1

1

If you know the particular attribute (text or background color, etc) of an element that changes, you can use the Get Element Attribute command

MobileElement element = (MobileElement) driver.findElementByAccessibilityId("SomeAccessibilityID");
String tagName = element.getAttribute("content-desc");
K-man
  • 353
  • 1
  • 13