1

PLS help me with vba selenium code. There is drop menu (name Select Bookmark) inside there is list with three option, i need to choose third option.

Tried to use some code from other solution but without success.

<ul id="aaa" class="bbb"> == $0
    ::before
    <li class="ccc">
        ::before
        <select>
            <option value>Select Bookmark</option>
            <option value="Server\BHG-145">bookmark_one</option>
            <option value="Server\BHG-155">bookmark_two</option>
            <option value="Server\BHG-165">bookmark_three</option>
        </select>
        ::after
    </li>
</ul>
2
  • Could you add the selenium you are currently using? Commented Sep 2, 2019 at 17:39
  • you should really include your current code. Commented Sep 2, 2019 at 18:40

1 Answer 1

1

You can use an attribute = value selector

driver.FindElementByCss("[value='Server\BHG-165']").selected = True
driver.FindElementByCss("[value='Server\BHG-165']").click

or select by index

driver.FindElementByCss(".ccc select").AsSelect.SelectByIndex 3

or by text

driver.FindElementByCss(".ccc select").AsSelect.SelectByText "bookmark_three"
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.