Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to get the native app font type or style using UI Automation JavaScript Reference for iOS appium

I have to test a native app using appium ios. In one of my test case my scenario is to get the Text font type or font size.

I use

.getCssValue("font-size")

but this does not work as the app does not have web view. Now i am trying to get this by using

UI Automation JavaScript Reference for iOS

i use the below code to get it:

 String name = (String) driver.executeScript("UIATarget.localTarget().frontMostApp().mainWindow().navigationBar().staticTexts()[0].fontName()");

but this does not work. I have stucked in this problem. Please help.

like image 987
Ali Azam Avatar asked Dec 04 '25 07:12

Ali Azam


1 Answers

Its not possible to get font size of the element at the moment, just because it does not supported by XCUIElementAttributes, so Appium that uses XCUITest as iOS framework has no possibility as well

like image 83
dmle Avatar answered Dec 06 '25 20:12

dmle