使用 Java 访问对象数组中的数据

Accessing data in an object array with Java

我目前正在使用 Cucumber 和 Java。我想从 ITestResult.

检索文件的路径

我目前正在检索参数:

Object[] test = testResult.getParameters();

然而,我唯一可以访问的似乎是第一个对象名称,除此之外别无其他。

test = {Object[1]@1492} 
    0 = {CucumberFeatureWrapper@1493} "Links at EDM Documents View,"
        cucumberFeature = {CucumberFeature@1516} 
            path = "test/01-automation.feature"
            feature = {Feature@1518} 
            cucumberBackground = null
            currentStepContainer = {CucumberScenario@1519} 
            cucumberTagStatements = {ArrayList@1520}  size = 1
            i18n = {I18n@1521} 
            currentScenarioOutline = null

无论如何我都看不到在黄瓜功能下检索 path = "test/01-automation.feature"

你试过((CucumberFeatureWrapper)test[0]).getCucumberFeature().getPath()吗?