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

pages.herokuapp.FileUpload Maven / Gradle / Ivy

Go to download

An open-source Selenium Java-based Test automation Framework that allows you to perform multiple actions to test a web application's functionality, behaviour, which provides easy to use syntax, and easy to set up environment according to the needed requirements for testing

There is a newer version: 1.1.1
Show newest version
package pages.herokuapp;

import driverfactory.webdriver.WebDriver;
import org.openqa.selenium.By;

public class FileUpload {

    public final WebDriver driver;

    By chooseFileButton = By.id("file-upload");
    By uploadFileButton = By.id("file-submit");
    By successMessage = By.cssSelector("h3");

    public FileUpload(WebDriver driver){
        this.driver = driver;
    }

    public FileUpload uploadingFile(){
        driver.element().fillField(chooseFileButton,"C:\\Users\\moham\\Downloads\\Cover_Letter.docx");
        return this;
    }

    public FileUpload clickOnSubmitButton(){
        driver.element().click(uploadFileButton);
        return this;
    }

    public FileUpload checkThatFileShouldBeUploaded(){
        driver.assertThat().element(successMessage).text().isEqualTo("File Uploaded!");
        return this;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy