Instantly share code, notes, and snippets.

View file.m
export class MyPageClass extends UI {
private static readonly someLocator1 = By.xpath(someXpath);
private static readonly someLocator2 = By.xpath(someXpath);
private static readonly someLocator3 = By.xpath(someXpath);
constructor(driver) {
super(driver)
}
View file.py
try {
} catch (Exception ex) {
}
View file.html
await console.log("smaaash.......");
const scriptToGetAlertText = `const result = document.evaluate(
\"//div[@id='titleError']/text()[normalize-space()]\",
document,
null,
XPathResult.STRING_TYPE,
null
);
return result.stringValue;`;
View file.cpp
boolean directoryEmpty = false;
while(!directoryEmpty) {
String dirPath = "C://YEAR_reports";
File dir = new File(dirPath);
String[] files = dir.list();
if (files.length == 0) {
System.out.println("The directory is empty");
directoryEmpty = true;
} else {
View file.cpp
while(!directoryEmpty) {
String dirPath = "C://YEAR_reports";
File dir = new File(dirPath);
String[] files = dir.list();
if (files.length == 0) {
System.out.println("The directory is empty");
directoryEmpty = true;
} else {
for (String aFile : files) {
View file.m
await this.driver.wait(until.elementLocated(someLocator));
return await this.driver.findElement(someLocator).getText();
View file.m
this.executeScript("arguments[0].scrollIntoView({behavior: \"instant\", block: \"center\", inline: \"nearest\"});", element);
View file.html
class LoginForm(PageComponent)class UsernameField(PageComponent):
_locator = (
By.ID,
"login",
)
username = UsernameField()
View file.html
class UsernameField(PageComponent):
_locator = (
By.ID,
"username",
)
View file.html
class UsernameField(PageComponent):
_locator = (
By.ID,
"username",
)