Skip to content

Instantly share code, notes, and snippets.

@borodicht
Created December 2, 2024 16:05
Show Gist options
  • Save borodicht/45bfd11df704a3c74b0b2838cac11f86 to your computer and use it in GitHub Desktop.
Save borodicht/45bfd11df704a3c74b0b2838cac11f86 to your computer and use it in GitHub Desktop.
public class SomeFile {
private double getResult(String sValue) {
Double value1 = Double.valueOf(String.value0f(driver.findElements(By.css("#value1")).getText()));
Double value2 = Double.valueOf(String.value0f(driver.findElements(By.css(".value2")).getText()));
String operation = driver.findElement(By.id("opeartion")).getText();
Double Dresult;
if (operation.equals("Сумма")) {
Dresult = value1 + value2;
} else if (operation.equals("Разница")) {
Dresult = value1 - value2;
} else if (operation.equals("Деление")) {
Dresult = value1 / value2;
}
return Dresult;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment