从二维对象数组中获取字符串值

时间:2014-12-17 04:27:54

标签: java testng

在TestNG中,我返回两个Dimensional对象[] [],其中 StaticVariable.channel_id.get(i)返回动态字符串值。

但是当我尝试对该字符串执行任何操作时,它来自此数据提供者的参数,它来自[channel_id], 例如 - [asda1ds216adsasda],当我执行URI请求时,它变为

http://www.example.com/channels/[asdad21321]

应为http://www.example.com/channels/asdad21321

@DataProvider(name="get_channel1")
    public static Object[][] createData4(){
        Object[][] object = new Object[StaticVariable.channel_id.size()][3];
        for (int i = 0; i < StaticVariable.channel_id.size(); i++) 
        {       
            object[i][0] = StaticVariable.channel_id.get(i);                            
            object[i][1] = new Integer(200);
            object[i][2] = "Pass";          
        }
        return object;  
}

0 个答案:

没有答案