@@ -0,0 +1,2986 @@
+package org.museautomation.selenium.values;%0A%0Aimport org.museautomation.builtins.value.*;%0Aimport org.museautomation.core.*;%0Aimport org.museautomation.core.events.*;%0Aimport org.museautomation.core.resource.*;%0Aimport org.museautomation.core.step.*;%0Aimport org.museautomation.core.values.*;%0Aimport org.museautomation.core.values.descriptor.*;%0Aimport org.museautomation.selenium.*;%0Aimport org.openqa.selenium.*;%0Aimport org.openqa.selenium.support.ui.*;%0A%0A/**%0A * @author Christopher L Merrill (see LICENSE.txt for license details)%0A */%0A@MuseTypeId(%22option-count%22)%0A@MuseValueSourceName(%22Option Count%22)%0A@MuseValueSourceTypeGroup(%22Selenium.Element.Value%22)%0A@MuseValueSourceShortDescription(%22Returns the number of options in a select element%22)%0A@MuseValueSourceLongDescription(%22Resolves the supplied element as a select control and then returns the number of options.%22)%0A@MuseStringExpressionSupportImplementation(OptionCountSource.StringExpressionSupport.class)%0A@MuseSubsourceDescriptor(displayName = %22Element%22, description = %22The element to get value from%22, name = %22element%22, type = SubsourceDescriptor.Type.Single)%0A@SuppressWarnings(%22unused%22)  // instantiated via reflection%0Apublic class OptionCountSource extends BaseElementValueSource%0A    %7B%0A    @SuppressWarnings(%22unused%22)  // used via reflection%0A    public OptionCountSource(ValueSourceConfiguration config, MuseProject project) throws MuseInstantiationException%0A        %7B%0A        super(config, project);%0A        %7D%0A%0A    @Override%0A    public Integer resolveValue(MuseExecutionContext context) throws ValueSourceResolutionError%0A        %7B%0A        WebElement element = resolveElementSource(context, true);%0A        try%0A            %7B%0A            Select select = new Select(element);%0A            return select.getOptions().size();%0A            %7D%0A        catch (UnexpectedTagNameException e)%0A            %7B%0A            throw new ValueSourceResolutionError(%22The element is not a %3Cselect%3E tag.%22);%0A            %7D%0A        %7D%0A%0A    @Override%0A    public String getDescription()%0A        %7B%0A        return String.format(%22elementAttribute(%25s,%25s)%22, getElementSource().getDescription(), _attribute_name_source.getDescription());%0A        %7D%0A%0A    private MuseValueSource _attribute_name_source;%0A%0A    public final static String TYPE_ID = OptionCountSource.class.getAnnotation(MuseTypeId.class).value();%0A    public final static String ELEMENT_PARAM = %22element%22;%0A%0A    public static class StringExpressionSupport extends BaseArgumentedValueSourceStringSupport%0A        %7B%0A        @Override%0A        public String getName()%0A            %7B%0A            return %22optionCount%22;%0A            %7D%0A%0A        @Override%0A        protected int getNumberArguments()%0A            %7B%0A            return 1;%0A            %7D%0A%0A        @Override%0A        protected String getTypeId()%0A            %7B%0A            return OptionCountSource.TYPE_ID;%0A            %7D%0A%0A        @Override%0A        protected boolean storeSingleArgumentAsSingleSubsource()%0A            %7B%0A            return true;%0A            %7D%0A        %7D%0A    %7D%0A

add optionCount() value source to return the number of options in a Select elemnt.