excelvbaselenium-webdriverxpathisenabled

Selenium Webdriver - Wait until user clicks button without ID


I am using Selenium Webdriver with an Excel VBA automatization in Chrome and I am having some trouble when waiting until users clics a button.

The web's code is the following:

web code

I have tried with FindElementByCss, FindElementByID..., also with IsPresent, IsEnabled... but nothing worked. Mi code right now is the following:

t = Timer
    Do While bot.FindElementById("ui-button-text").IsPresent = True
        bot.Wait 500
        If Timer - t = 10 Then Exit Do 'Para evitar bucle infinito
    Loop

Thanks in advance!


Solution

  • As per the HTML:

    66044675

    ui-button-text is the value of the class attribute, but not of the id attribute and there are multiple <span> elements with class attribute value as ui-button-text with different textContent.


    To validate the presence of the elements you can use the following Locator Strategies:


    To validate the if the elements are enabled, you can use the following Locator Strategies: