Kotlin PageFactory not initializing List elements

62 views
Skip to first unread message

Kevin Bonnett

unread,
Mar 31, 2021, 4:52:37 AM3/31/21
to Selenium Users
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!

vijay...@gmail.com

unread,
Apr 1, 2021, 5:27:53 AM4/1/21
to Selenium Users
Dear All,
i am facing one  issue  i want close two window one is modal and another one is iframe and navigate back to userlist how can i achieve this


thnks
vijay 

Reply all
Reply to author
Forward
0 new messages