无法将 ArrayList 值返回到测试用例错误 :Could not find matching constructor for: java.util.ArrayList(java.awt.Dimension)我的代码:关键词:public ArrayList<Integer> othersites() { String[] sits = new String[9]; sits[0] = "https://www.tadawul.com.sa/wps/portal/tadawul/home/"; sits[1] = "https://www.msm.gov.om/"; WebUI.navigateToUrl(sits[0]); String tdwl = WebUI.getText(findTestObject('ObjectRepository/Sites/site_tdwl'),FailureHandling.CONTINUE_ON_FAILURE) String[] parts0 = tdwl.split("\\.") String part0 = parts0[0]; // 00 String part00 = Integer.parseInt(part0.replaceAll(",", "")) . . List<String> list = new ArrayList<String>(); list.add(part00); list.add(part11); List<Integer> newList1 = new ArrayList<Integer>(list.size()) ; for (String myInt1 : list) { newList1.add(Integer.valueOf(myInt1)); } return newList1 }} 自定义关键字:CustomKeywords.'decypha_equities.otherSiteValuesCapture.othersites'()预期结果:[8566, 3869, 6606, 9806, 2791, 14304, 1529, 1847, 5028]实际结果:找不到匹配的构造函数:java.util.ArrayList(java.awt.Dimension)
1 回答
守着星空守着你
TA贡献1799条经验 获得超8个赞
您的方法返回 aList不是 an ArrayList,而是更改:
public ArrayList<Integer> othersites() {
到 :
import java.util.ArrayList;
import java.util.List;
...
public List<Integer> othersites() {
添加回答
举报
0/150
提交
取消