创建测试,在一个循环中

创建测试,在一个循环中

问题描述:

我需要创建一个测试,将基本URL(https://www.horisen.com),并添加国家代码的一部分(即https://www.horisen.com/se)加国家代码。对我来说问题是有12个国家需要改变。 我试图创建如果循环没有任何成功。 因此,总而言之,我必须浏览所有12种不同的语言,以当前语言打开这些页面,并继续阅读下一个语言。我想我需要一个由12个国家代码组成的数组,并且在循环中调用它,但不知道如何实现这一点。 预先感谢您创建测试,在一个循环中

String url = htps://www.horisen.com/ 
int[] array; 

array = new int[6]; 

array[0] = de; 
array[1] = se; 
array[2] = dk; 
array[3] = fr; 
array[4] = en; 
array[5] = fi; 

for(int i=0; i++) { 
do not know how to add after string url country code on the ned 
} 
+0

http://idownvotedbecau.se/nocode/ – khelwood

下一次,请把一些实际的Java代码(即编译)在你的榜样。也许你正在寻找的是这样的:

String url = "https://www.horisen.com/"; 
    String[] countryCodes = {"de", "se", "dk", "fr", "en", "fi"}; 
    for (String countryCode : countryCodes) { 
     String countryUrl = url + countryCode; 
     System.out.println(countryUrl); 
    } 
+1

谢谢@Stefan。就像我一直在寻找的东西 – Zoran