Skip to content

Instantly share code, notes, and snippets.

View Ankit-Laddha's full-sized avatar
🎯
Focusing

Ankit Ankit-Laddha

🎯
Focusing
View GitHub Profile
package com.citi.cpb.sit.assertions;
import io.restassured.response.Response;
import static org.assertj.core.api.Assertions.assertThat;
public class ResponseAssertion {
private static final int maxChars = 2000;
@Ankit-Laddha
Ankit-Laddha / DriverUtils.java
Created March 5, 2018 11:03
ThreadLocal Class for Webdriver
public class DriverUtils {
private static final String CHROME = "chrome";
private static final String INTERNET_EXPLORER = "internetexplorer";
public static String browserName = System.getenv("browser_name") == null ? "internetexplorer" : System.getenv("browser_name");
private static DriverUtils instance = new DriverUtils();
public static ThreadLocal<WebDriver> CURRENT_DRIVER = ThreadLocal.withInitial(() -> // thread local CURRENT_DRIVER object for webdriver
{
if (browserName.equalsIgnoreCase(CHROME)) {
@Ankit-Laddha
Ankit-Laddha / GeneralWaitsWithPOM
Last active March 2, 2018 06:52
Normal waits conditions to be used with Page Object Model
public boolean isElementDisplayed(WebElement element) {
try {
return element.isDisplayed();
} catch (NoSuchElementException | TimeoutException | StaleElementReferenceException ex) {
return false;
}
}
public boolean areElementsDisplayed(List<WebElement> elements) {