Our vBulletin migration is complete.
Welcome vBulletin users! All content and user information from the Micro Focus Forums (vBulletin) site has been migrated to this site. READ MORE.
XsiSec Absent Member.
Absent Member.
393 views

TestObject List issues

Jump to solution

Hello everyone,

I have got following following two public classes:

public class TestObjectContainer{
public ArrayList<TestObject>ChangeOrderList=new ArrayList<TestObject>();
}

Then I have got:

 

public class ReadTestData
{

public TestObjectContainer fillData()
{

Object ChangeOrderTxt;

TestObjectContainer result=new TestObjectContainer();
int n=0;

List<TestObject>iList=new ArrayList<TestObject>();
iList=(desktop.findAll("//RumbaLabel[@caption='D-******']"));

for(TestObject label: iList) {
ChangeOrderTxt=(label.getProperty("caption")); //my String 

 

//This is what I have tried with below:

System.out.println(ChangeOrderTxt);
result.ChangeOrderList.addAll(n++, iList); 

// END


}

}

}

 

I get error this methot must return a result of type TestObjectContainer

 

Could someone help me?

Thank you in advance


Regards


Xsi

Tags (2)
0 Likes
1 Solution

Accepted Solutions
Highlighted
AndySchott Absent Member.
Absent Member.

RE: TestObject List issues

Jump to solution

Based on the code you posted, the problem is that fillData() isn't returning anything. Adding return result; to the end of the method should fix this.

Andy

0 Likes
1 Reply
Highlighted
AndySchott Absent Member.
Absent Member.

RE: TestObject List issues

Jump to solution

Based on the code you posted, the problem is that fillData() isn't returning anything. Adding return result; to the end of the method should fix this.

Andy

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.