In my Kotlin repo, I have a page object where I need to get a List of elements, but when using PageFactory.initElements, the List element is not being initialized. The page object code and error are below.
@FindBy(css = "div[class*='company-picker'] h3")
lateinit var companyNames: List<WebElement>
init {
PageFactory.initElements(driver, this)
}
kotlin.UninitializedPropertyAccessException: lateinit property companyNames has not been initialized
Thanks!