Friday, April 3, 2015

Basics of Selenium 1

/**
     * implicit wait method  
     * @param Time
     */
    public  void impWait(int Time){
        driver.manage().timeouts().implicitlyWait(Time, TimeUnit.SECONDS);
    }
    /**
     * window maximized
     */
    public  void windowMaximize(){
        driver.manage().window().maximize();
    }
    /**
     *
     * @return current window title
     */
    public  String getTitle(){
        return driver.getTitle();
    }
 
     * click on the element method
     */
    public void clickOnElement(WebElement e){
        e.click();
    }
    /*
     * clear  method
     */
    public void clear(WebElement e){
        e.clear();
    }
    /*
     * get text method
     */
    public String getElementText(WebElement e){
        return e.getText();
        }
    /*
     * get attribute  method
     */
    public String getElementAttribute(WebElement e,String attribute){
        return e.getAttribute(attribute);
        }
    /*
     * getCss value method
     */
    public String getCssValue(WebElement e,String css){
        return e.getCssValue(css);
       
    }
/*
 * type text method
 */
    public void typeText(WebElement e,String text){
        e.sendKeys(text);
    }

No comments:

Post a Comment