All Downloads are FREE. Search and download functionalities are using the official Maven repository.

bichromate.sample.pageDeclaration.sTestCalculatorStandardView Maven / Gradle / Ivy

Go to download

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.

There is a newer version: 3.13
Show newest version
package bichromate.sample.pageDeclaration;

import org.openqa.selenium.winium.WiniumDriver;


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();
    }
	
	

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy