Refrence: Speeding up end-to-end tests

I tried removing implicit and I found myself ending up writing too much code for every click and sendkeys etc. I have to put wait condition for every base function.

Implicit Wait:

public  openBrowser() {
 System.setProperty(".chrome.driver", System.getProperty("user.dir") + getProperty("chromeDriver_exe"));
            driver = new ChromeDriver();
        } 
 driver.manage().window().maximize();
 driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);

    }

Click Function:

public void click(String locatorKey) {
        //Put Wait condition else element will be remain unattended/notFound
        driver.findElement(By.xpath(xpathExpression)).click();

        logger("Clicked on " + locatorKey);
    }



Source link https://sqa.stackexchange.com/questions/34405/how-to--

LEAVE A REPLY

Please enter your comment!
Please enter your name here