xxxxxxxxxx
eturns true if the operand value matches a pattern.
Example: Returns true if the user’s first_name ends with ‘son’.
SELECT * FROM users
WHERE first_name LIKE '%son';
xxxxxxxxxx
WHERE CustomerName LIKE 'a%'
--Finds any values that start with "a"
WHERE CustomerName LIKE '%a'
--Finds any values that end with "a"
WHERE CustomerName LIKE '%or%'
--Finds any values that have "or" in any position
WHERE CustomerName LIKE '_r%'
--Finds any values that have "r" in the second position
WHERE CustomerName LIKE 'a__%'
--Finds any values that start with "a" and are at least 3 characters in length
WHERE ContactName LIKE 'a%o'
--Finds any values that start with "a" and ends with "o"
xxxxxxxxxx
-- LIKE is case sensitive pattern matching and ILIKE is case insensitive pattern matching
SELECT *
FROM table_name
WHERE col1 LIKE '__t%' AND col2 NOT ILIKE 'a%t_ ;
xxxxxxxxxx
SELECT employee_id, first_name, last_name
FROM employees
WHERE first_name LIKE 'John%';
xxxxxxxxxx
package pages;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
public class LoginPage {
WebDriver driver;
//Constructor that will be automatically called as soon as the object of the class is created
public LoginPage(WebDriver driver) {
this.driver = driver;
}
//Locator for username field
By uName = By.id("userName");
//Locator for password field
By pswd = By.id("password");
//Locator for login button
By loginBtn = By.id("login");
//Method to enter username
public void enterUsername(String user) {
driver.findElement(uName).sendKeys(user);
}
//Method to enter password
public void enterPassword(String pass) {
driver.findElement(pswd).sendKeys(pass);
}
//Method to click on Login button
public void clickLogin() {
driver.findElement(loginBtn).click();
}
}