bichromate.sample.pageDeclaration.sTestCalculatorStandardView Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of Bichromate Show documentation
Show all versions of Bichromate Show documentation
Java, Selenium, Appium, Winium, Extend, and TestNG automated testing framework. Bichromate integrates the best of these frameworks and takes automation to the next level. With Bichromate there is one function call that builds any type of Web,IOS Mobile, Android, and Windows App driver on any platform (Windows, Mac, Linux). From Local web drivers, to SauceLabs, Browserstack, and Selenium grid. Build data driven tests is never easier.
Bichromate also gives you built in Factories that, access DBs, Video Capture, FTP, POM Generation, Hilite element.
package bichromate.sample.pageDeclaration;
import org.openqa.selenium.winium.WiniumDriver;
import bichromate.core.sTestBasePageDeclaration;
public class sTestCalculatorStandardView {
private WiniumDriver app = null;
public sTestCalculatorStandardView(WiniumDriver appDriver){
app = appDriver;
}
public int add(int firstNumber, int secondNumber) {
return compute("Add", firstNumber, secondNumber);
}
public int subtract(int firstNumber, int secondNumber) {
return compute("Subtract", firstNumber, secondNumber);
}
public int multiply(int firstNumber, int secondNumber) {
return compute("Multiply", firstNumber, secondNumber);
}
public int divide(int firstNumber, int secondNumber) {
return compute("Divide", firstNumber, secondNumber);
}
private int compute(String type, int firstNumber, int secondNumber) {
app.findElementByName(String.valueOf(firstNumber)).click();
app.findElementByName(type).click();
app.findElementByName(String.valueOf(secondNumber)).click();
app.findElementByName("Equals").click();
Double result = Double.parseDouble(app.findElementById("150").getAttribute("Name"));
return result.intValue();
}
}