double displayValue = 0;
if (!"".equals(dispFieldText)) {
try {
displayValue = Double.parseDouble(dispFieldText);
}catch (NumberFormatException e1){
HashMap<String,Integer> map = new HashMap<>();
map.put("I",1);
map.put("II",2);
map.put("III",3);
map.put("IV",4);
map.put("V",5);
map.put("VI",6);
map.put("VII",7);
map.put("VIII",8);
map.put("IX",9);
displayValue = Double.parseDouble(String.valueOf(map.get(dispFieldText)));
}
}
Object src = e.getSource(); //для каждого деяствия кнопочки
public static void main(String[] args) {
WebDriver driver = null;
ChromeOptions opt = new ChromeOptions();
ChromeDriverManager.getInstance(DriverManagerType.CHROME).setup();
opt.addArguments("--start-maximized");
driver = new ChromeDriver(opt);
driver.manage().window().setSize(new Dimension(1920, 1080));
driver.get("https://kenwheeler.github.io/slick");
WebElement el = driver.findElement(By.className("slick-arrow"));
for (int i = 0; i <50; i++) {
el.click();
System.out.println("hello");try {
Thread.sleep(1000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
String[] shops = { "DE", "CH", "AT", "NL", "FR", "DK", "ES", "IT", "EN", "SE", "NO", "FI", "PT", "BE", "LU",
"RO", "GR", "CZ", "PL", "HU" };
List<String> list = new ArrayList<String>(Arrays.asList(shops));
StringBuilder builder = new StringBuilder();
int count =0;
while (count < 5) {
Random r = new Random();
int rand = r.nextInt(list.size());
builder.append(list.get(rand)).append(" ");
list.remove(rand);
count++;
}
String shopsForTest = builder.toString();
System.out.println(shopsForTest);