I'm honestly not even sure what to do at this point I'm not getting any error logs in the console just the logger messages that I've put into the scripts.
When I get to the line of code where I create the Dashboard Constructor it terminates the test and declares it a failure, last logged message is always "About to start looking"
I even gutted the entire constructor(commented out all code, removed the driver parameter, and just put a print statement in it) before posting this question and when I called the print method within the class the script failed at the line where the creation of the constructor happened.
I don't understand what's going on I could be missing something very obvious. I get failure but I don't necessarily see a specific error message in the console either.
Here is the test case im attempting to run:
package com.symphio.testCases;
import java.util.concurrent.TimeUnit;
import org.testng.Assert;
import org.testng.annotations.Test;
import com.symphio.pageObjects.Dashboard;
import com.symphio.pageObjects.loginSymphio;
public class TC_Dashboard_Search_002 extends BaseClass{
@Test
public void searchForTile() throws InterruptedException {
logger.info("Connected to "+ baseURL);
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
loginSymphio login = new loginSymphio(driver);
//logs in
login.setUserName(userName);
logger.info("entered username");
login.setPassWord(passWord);
logger.info("entered password");
login.pressSubmit();
logger.info("button pressed");
//searches for tile
Thread.sleep(3000);
logger.info("about to start looking");
Dashboard dashboard = new Dashboard(driver);
dashboard.mouseMover();
logger.info("found Icon");
dashboard.searchBarText(searchText);
logger.info("input text");
dashboard.tileClick();
logger.info("clicked");
}
}
Here is my DashBoard pageObject
package com.symphio.pageObjects;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.interactions.Actions;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.PageFactory;
public class Dashboard {
WebDriver driver;
public Dashboard(WebDriver driver) {
this.driver = driver;
PageFactory.initElements(driver, this);
}
@FindBy(className="search-container")
WebElement searchImg;
@FindBy(xpath="//input[@type='search']")
WebElement searchText;
@FindBy(xpath="//input[contains(@class,'mat-card'), and contains(@class, 'mat-focus-indicator'), and contains(@class, 'arrangement-card')]")
WebElement tileBox;
Actions actions = new Actions(driver);
public void mouseMover() {
Actions mouseOverOnElement = actions.moveToElement(searchImg);
mouseOverOnElement.perform();
}
public void searchBarText(String text) {
searchText.sendKeys(text);
}
public void tileClick() {
tileBox.click();
}
}
Console error: