0

HP Quality Center Automationのotalclient.dllを使用して、ルートからのテストセットのリストを決定しています。oleメソッドはリスト(具体的にはIFactoryList)を返しますが、リストを配列に変換する方法を学ぶために何をする必要があるのか​​、または読む必要があるのでしょうか。

コード:

qc_connection = WIN32OLE.new('tdapiole80.TDConnection')
qc_connection.InitConnectionEx connection_url
qc_connection.login connection_name, connection_pwd
qc_connection.Connect qcDomain, qcProject
tree_manager = qc_connection.TestSetTreeManager
test_set_factory = qc_connection.TestSetFactory
test_set_list = test_set_factory.NewList("")
4

1 に答える 1

1

リストを直接配列に変換できないようです。.each は機能しますが、もし私がその気になったら、次のことができるかもしれません:

list_to_array = Array.new

<List>.each do |list_item|
  list_to_array << list_item
end

しかし、Visual Studio でリストを見ると、単にリスト アイテムのメンバーを探しているだけで、代わりにそれを取得していることに気付きました。

list_to_array = Array.new

<List>.each do |list_item|
  list_to_array << list_item.Name
end
于 2011-12-14T16:47:21.107 に答える