Wednesday, September 9, 2015

Selenium : Passing Arguements using "By" class

Passing locator Arguments using "By" class


Passing locator in Selenium before its existence .(small snippet below)

class base_Library{

public static void main(String args[])

{
    Lib base_Library=new base_Library();
    base_Library.wait_to_load(By.id("templateCombobox"));
}

public void wait_to_load(By by){
        WebDriverWait wait = new WebDriverWait(driver,10);        wait.until(ExpectedConditions.elementToBeClickable(by));
    }
}




No comments:

Post a Comment