Skip to content

Instantly share code, notes, and snippets.

package pages;
import com.shaft.driver.SHAFT;
import com.shaft.tools.io.ReportManager;
import io.qameta.allure.Param;
import io.qameta.allure.Step;
import org.openqa.selenium.By;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.WebElement;
WebElement finalElement;
int count = 0;
int maxTries = 2000;
boolean isAccepted = selection.equals(true);
String script = "return document.querySelector('#usercentrics-root').shadowRoot.querySelector(" +
(isAccepted ? "'button[data-testid=\"uc-accept-all-button\"]'" : "'button[data-testid=\"uc-deny-all-button\"]'") + ");";
while (true) {
try {
// Clicking on the shadow element under the shadow root using JavaScript
This file has been truncated, but you can view the full file.
<!DOCTYPE html>
<html dir="ltr" lang="en">
<head>
<meta charset="utf-8">
<title>Test</title>
<link rel="icon" href="data:image/x-icon;base64,AAABAAMAEBAAAAEAIABoBAAANgAAACAgAAABACAAKBEAAJ4EAAAwMAAAAQAgAGgmAADGFQAAKAAAABAAAAAgAAAAAQAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACYgnIvkHtqlW2Lktcsue/4JL/89yW/+9cmwPyVJr7/LyfB/yEkv/vSJL/78CTB/GMAAAAAAAAAAKqOjgmhi3yYmoR2/ZR+bv4/rtf/JL/7/yS/+/8kv/v/JMD8/iO9+/wjvPngJL/7/yS/+/8kv/vwAAAAAFWOOQmpl4XBpY+A/56Jev+YgnP/TafI/yS/+/8kv/v/JL/7/yO9+v4fs/X+Ibf4/iS/+/8kv/v/JL77/QAAAABfijeZsJuL/6mUhf+jjX//nYd4/5CGfN47st2lJcD6pSO8+d8fsvT/Gqbv/x+y9P8kv/v/JL/7/yS++/1FjxswSY4c/aedgv+umYr/qJKD+aGNfmeAgIACAAAAAAAAAAAAqqoDG6fwaBab6vgdrfL/JL/7/yS/+/8kvvv9TJwblkqZG/9Umib+cplH/3WWS2YAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAARjuRoG6nw/yS/+/8kv/v/JL77/VGpHthQph3+T6Qd/k6iHN2AgAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAID/Aimk6d+ngLT/wXWn/1mm3/1XtCD5VrIf/1WxH/5Urx+jAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADGbKGl9lyL//Zci//hZpb9XcEi+Vy+Iv9bvCH/W7shogAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
(base) \n\u/../\W/: mvn test -DENVIRONMENT="stg" -Dtest="*WebTests#userAbleToReIdentifyWithIDNOW" -DdeleteUserAfterExecution=no
[INFO] Scanning for projects...
[INFO]
[INFO] ----------------< de.bonify.b2c:b2c-qa-web-automation >-----------------
[INFO] Building b2c-qa-web-automation 1.0-SNAPSHOT
[INFO] from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[WARNING] 1 problem was encountered while building the effective model for org.javassist:javassist:jar:3.18.1-GA during dependency collection step for project (use -X to see details)
[INFO]
[INFO] --- resources:3.3.1:resources (default-resources) @ b2c-qa-web-automation ---
@myoussef87
myoussef87 / gist:351adecff198d36784bd58246c9d36ce
Created September 28, 2024 15:32
Console_log_shaft_8.3.20240924-beta
----------------------------------------------------------------------------------------------------------------------------------------
| com.shaft.tools.io.ReportManager - main - 05:27:41 pm
[INFO] Initializing Properties... | com.shaft.tools.io.ReportManager - main - 05:27:41 pm
[INFO]
------------------------------------------------------------------------------------------------------------------------------------------------
Starting execution of before class configuration method
'TestPackage.TestClass.beforeClass'
------------------------------------------------------------------------------------------------------------------------------------------------
| com.shaft.tools.io.ReportManager - main - 05:27:41 pm
[INFO] Loaded Test Data: "src/test/resources/testDataFiles/simpleJSON.json". | com.shaft.t
@myoussef87
myoussef87 / gist:ef17ca28df98252a4f920f7fbb5cfd2a
Created September 28, 2024 15:23
Allure_report_Shaft_8.3.20240924-beta
This file has been truncated, but you can view the full file.
<!DOCTYPE html>
<html dir="ltr" lang="en">
<head>
<meta charset="utf-8">
<title>Test</title>
<link rel="icon" href="data:image/x-icon;base64,AAABAAMAEBAAAAEAIABoBAAANgAAACAgAAABACAAKBEAAJ4EAAAwMAAAAQAgAGgmAADGFQAAKAAAABAAAAAgAAAAAQAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACYgnIvkHtqlW2Lktcsue/4JL/89yW/+9cmwPyVJr7/LyfB/yEkv/vSJL/78CTB/GMAAAAAAAAAAKqOjgmhi3yYmoR2/ZR+bv4/rtf/JL/7/yS/+/8kv/v/JMD8/iO9+/wjvPngJL/7/yS/+/8kv/vwAAAAAFWOOQmpl4XBpY+A/56Jev+YgnP/TafI/yS/+/8kv/v/JL/7/yO9+v4fs/X+Ibf4/iS/+/8kv/v/JL77/QAAAABfijeZsJuL/6mUhf+jjX//nYd4/5CGfN47st2lJcD6pSO8+d8fsvT/Gqbv/x+y9P8kv/v/JL/7/yS++/1FjxswSY4c/aedgv+umYr/qJKD+aGNfmeAgIACAAAAAAAAAAAAqqoDG6fwaBab6vgdrfL/JL/7/yS/+/8kvvv9TJwblkqZG/9Umib+cplH/3WWS2YAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAARjuRoG6nw/yS/+/8kv/v/JL77/VGpHthQph3+T6Qd/k6iHN2AgAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAID/Aimk6d+ngLT/wXWn/1mm3/1XtCD5VrIf/1WxH/5Urx+jAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADGbKGl9lyL//Zci//hZpb9XcEi+Vy+Iv9bvCH/W7shogAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
java.lang.AssertionError: File Action "ReadFile" failed. Root cause: "java.nio.charset.MalformedInputException: Input length = 1"
at org.testng.Assert.fail(Assert.java:99)
at com.shaft.tools.io.internal.FailureReporter.fail(FailureReporter.java:38)
at com.shaft.cli.FileActions.failAction(FileActions.java:695)
at com.shaft.cli.FileActions.failAction(FileActions.java:690)
at com.shaft.cli.FileActions.readFile(FileActions.java:372)
at com.shaft.tools.io.internal.ReportHelper.lambda$attachPropertyFiles$0(ReportHelper.java:39)
at java.base/java.util.Arrays$ArrayList.forEach(Arrays.java:4266)
at com.shaft.tools.io.internal.ReportHelper.attachPropertyFiles(ReportHelper.java:39)
at com.shaft.listeners.internal.ConfigurationHelper.suiteSetup(ConfigurationHelper.java:14)
@myoussef87
myoussef87 / Exception 2
Last active August 23, 2024 14:55
Exception
java.lang.AssertionError: Driver Factory Action "createNewLocalDriverInstance" failed. With the following test data "Failed to create new Browser Session". Root cause: "org.openqa.selenium.devtools.DevToolsException: Unable to create DevTools connection"
at org.testng.Assert.fail(Assert.java:99)
at com.shaft.tools.io.internal.FailureReporter.fail(FailureReporter.java:38)
at com.shaft.driver.internal.DriverFactory.DriverFactoryHelper.failAction(DriverFactoryHelper.java:111)
at com.shaft.driver.internal.DriverFactory.DriverFactoryHelper.createNewLocalDriverInstance(DriverFactoryHelper.java:405)
at com.shaft.driver.internal.DriverFactory.DriverFactoryHelper.createNewLocalDriverInstance(DriverFactoryHelper.java:403)
at com.shaft.driver.internal.DriverFactory.DriverFactoryHelper.createNewLocalDriverInstance(DriverFactoryHelper.java:403)
at com.shaft.driver.internal.DriverFactory.DriverFactoryHelper.createNewLocalDriverInstance(DriverFactoryHelper.java:403)
at com.shaft.driver.internal.DriverFactory.DriverF