java.lang.IllegalArgumentException: Driver must be set

793 views
Skip to first unread message

sandy

unread,
Apr 12, 2023, 12:46:39 AM4/12/23
to Selenium Users
Hi All,
Any leads would be helpful
Iam getting the error:
 java.lang.IllegalArgumentException: Driver must be set

in :at utils.FreeCRMApplicationUtil.menuclick(FreeCRMApplicationUtil.java:167)

Below is the method:
public void menuclick(By parentmenu,By childmenu)
{
Actions action = new Actions(driver);
action.moveToElement(getElement(parentmenu)).perform();
action.moveToElement(getElement(childmenu)).click().perform();

}

public WebElement getElement(By locator) {
WebElement element = driver.findElement(locator);
return element;
}

have created the constructor of the class

public FreeCRMApplicationUtil(WebDriver driver) {

this.driver = driver;

}

Sapna Chouhan

unread,
Apr 12, 2023, 1:40:41 AM4/12/23
to seleniu...@googlegroups.com
I think because you are not provide the driver path.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/00cb82cf-d57d-42f2-9888-7ff86c7b6401n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages