Running the scripts from jenkins in a remote windows machine. The scripts are running fine with no issues at all if run in local or if run with remote windows machine open ( looking at the screens). But when run when i am not actively watching the scripts run on windows remote machine. That too its failing at a particular point where the script is not entering the data in fields. However it passed through multiple screens entering the data. It only fails at a particular page.
Command run : bat "C:\Dev\apache-maven-3.6.1\bin\mvn clean verify -Dstory=${storyFileVar} -DtestCase=${testCase} -Denv.USER=${DevEnvironmentNameVar} -Dservice.env=pipelines -Dmaven.clean.failOnError=false -Dwebdriver.driver=provided -Dwebdriver.provided.type=sf -Dwebdriver.provided.sf=sf.icp.selenium.bdd.serenity.SerenityWebDriverWrapper -Dchrome.switches="--disable-extensions,--no-sandbox, --disable-gpu, --disable-dev-shm-usage, enable-automation, --headless, --disable-dev-shm-usage, start-maximized, --disable-infobars, --disable-browser-side-navigation""
System.out.println("checkpoint 1");
Assert.assertTrue(Namefrom.equals(NameFromPage.getText()));
WebDriverWait wait = new WebDriverWait(getDriver(), 10);
wait.until(ExpectedConditions.visibilityOf(firstName));
HighlightElement.highlightElement(getDriver(), firstName);
firstName.type("test name");
HighlightElement.highlightElement(getDriver(), emailTestEmail);
emailTestEmail.type("testemailid@gmail.com");
HighlightElement.highlightElement(getDriver(), emailTextField);
emailTextField.type("sample text so test the email module");
sendButton.click();
System.out.println("checkpoint 9");
checkpoint 1 is printing but not checkpoint 9. However HighlightElement.highlightElement are getting executed , but only not seeing the .type() getting executed, (seen this behaviour when the script is stuck in Jenkins and when i opened the windows remote machine and see the screen is stuck there) , i dont see any fields filled but only when i open the remote machine the script fails saying the element is not enabled. ( till then it keeps there and render message is seen if i dont open the windows remote machine)
I tried every solution present in this but nothing worked. :Selenium Timed out receiving message from renderer
I dont suspect chrome driver issue as the first 2 pages are succesfully executed before coming to this page.