im trying to select a drop down menu on a website but im completely lost on how to do so. i googled the hell out of it but no luck on finding anything. this is what im tryin
Found a better solution which will select the value with exact text
Define a function
applicationList is the id of the select tag
test abc is the exact text to match
function Subscription()
{
$x = $IE.document.getElementById("applicationList");
for($i=0;$i -lt $x.length;$i++)
{
If($x.options[$i].text -eq "test abc")
{
return $i;
}}}
Call the Function
$index=Subscription;
$IE.Document.getElementById("applicationList").SelectedIndex=$index;
Try this:
# will select item with label 9
$dropdown = $ie.Document.getElementById("skuAndSize")
($dropdown | where {$_.innerHTML -eq "9"}).Selected = $true