0

I am using Powershell with Selenium and need to select an item from a drop down. The page is https://app.beefy.finance/ . I need to change "Vault Type" from "ALL" to "Single assets"

$browser = Start-SeChrome
$URL = "https://app.beefy.finance/"
$browser.Navigate().GoToURL($URL)
#----- Wait statements here ------
$Select_Option = $browser.FindElementById("select-vault-type")

#At this stage I have tried the following commands but they all error out:
Set-SeSelectValue -By Value -value 'Single Assets' -Element $Select_Option
$Select_Option.SelectByValue('Single Assets')
$Select_Option.Text('Single Assets')

I have even tried using xpath but that fails as well

1
  • The issue is that the select element in this case it actually a <ul> and the options are <li> without a value attribute. Commented May 23, 2021 at 17:53

1 Answer 1

1

You need to click on the drop down for the object to appear. Then you can find it and click on it. i used it's XPath:

$browser = Start-SeChrome
$URL = "https://app.beefy.finance/"
$browser.Navigate().GoToURL($URL)
#----- Wait statements here ------
$Select_Option = $browser.FindElementById("select-vault-type")
$Select_Option.Click()
$Select_Option.FindElementByXPath('/html/body/div[4]/div[3]/ul/li[2]').Click()
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.