2016-07-19 9 views
1

現在、キュウリとJavaで作業しています。ファイルのパスをITestResultから取得したいと思います。Javaを使用したオブジェクト配列のデータへのアクセス

私は現在でパラメータを取得しています:私がアクセスできる唯一のことは、最初のオブジェクトの名前と他には何も思わしかし

Object[] test = testResult.getParameters(); 

test = {Object[1]@1492} 
    0 = {[email protected]} "Links at EDM Documents View," 
     cucumberFeature = {[email protected]} 
      path = "test/01-automation.feature" 
      feature = {[email protected]} 
      cucumberBackground = null 
      currentStepContainer = {[email protected]} 
      cucumberTagStatements = {[email protected]} size = 1 
      i18n = {[email protected]} 
      currentScenarioOutline = null 

キュウリの機能でpath = "test/01-automation.feature"を検索すると、わかりません。

答えて

1

((CucumberFeatureWrapper)test[0]).getCucumberFeature().getPath()のようなものを試しましたか?

+0

おかげで残念なことに、テスト中のキュウリは何もありません[0]。 – Smoeey

+0

私は自分の答えを編集しました。 'Object'配列の最初の要素は必要なパスを含む' CucumberFeatureWrapper'オブジェクトです。 –

+1

それは動作します!素晴らしい!ありがとうございました!私はまったくそれを見ませんでした。 – Smoeey

関連する問題