Skip to content

Instantly share code, notes, and snippets.

@borodicht
Created October 13, 2025 12:17
Show Gist options
  • Save borodicht/8aa402966ae490807bee6745b60a996d to your computer and use it in GitHub Desktop.
Save borodicht/8aa402966ae490807bee6745b60a996d to your computer and use it in GitHub Desktop.
package tests;
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