I want to count the numbers of elements aiming to get all their names and store in an array.
The names are highlighted in this image
The names are store in "js-list list-wrapper" as shown in image
My code:
Public Sub seleniumtutorial()
Dim bot As New SeleniumWrapper.WebDriver
Dim a As WebElement
Dim b As WebElement
Dim x() As Integer
bot.Start "chrome", "https://trello.com/login"
bot.get "/"
bot.Type "name=user", "biaverly@id.uff.br"
bot.Type "name=password", "xxxxxxx"
bot.clickAndWait "id=login"
bot.findElementByLinkText("Gestão de Pessoas").Click
I tried:
Set a = bot.findElementsByClassName("board-canvas", 5).Count
and find elements by xpath,and id.
I got the xpath from a random element in the class "js-list list-wrapper" and it was: //*[@id="board"]/div[5].
So i solved it using
Dim titles As Object
Set titles =
bot.findElementsByXPath("//[@id=""board""]/div")
Dim ab As Long
ab = titles.Count
MsgBox ab