無(wú)法將 ArrayList 值返回到測(cè)試用例錯(cuò)誤 :Could not find matching constructor for: java.util.ArrayList(java.awt.Dimension)我的代碼:關(guān)鍵詞: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 }} 自定義關(guān)鍵字:CustomKeywords.'decypha_equities.otherSiteValuesCapture.othersites'()預(yù)期結(jié)果:[8566, 3869, 6606, 9806, 2791, 14304, 1529, 1847, 5028]實(shí)際結(jié)果:找不到匹配的構(gòu)造函數(shù):java.util.ArrayList(java.awt.Dimension)
1 回答

守著星空守著你
TA貢獻(xiàn)1799條經(jīng)驗(yàn) 獲得超8個(gè)贊
您的方法返回 aList不是 an ArrayList,而是更改:
public ArrayList<Integer> othersites() {
到 :
import java.util.ArrayList;
import java.util.List;
...
public List<Integer> othersites() {
添加回答
舉報(bào)
0/150
提交
取消