Example #1
0
        public void SetAttributeValue(string attributeName, string attributeValue, AttributeOperationType setAttributeType, AmazonCommandArguments search, TimeSpan timeout)
        {
            var element = GetElementInFrame(search, timeout);

            if (element != null)
            {
                if (IsAttributeOprtationType(element, attributeName, setAttributeType))
                {
                    element.SetAttribute(attributeName, attributeValue);
                }
                else
                {
                    element.SetProperty(attributeName, attributeValue);
                }
            }
            if (string.IsNullOrEmpty(search.IFrameSearch?.Value) == false)
            {
                webDriver.SwitchTo().DefaultContent();
            }
        }
Example #2
0
 private bool IsAttributeOprtationType(IWebElement element, string attributeName, AttributeOperationType setAttributeType)
 {
     return(setAttributeType == AttributeOperationType.ForceAttribute ||
            (setAttributeType == AttributeOperationType.PreferAttribute && element.IsAttribute(attributeName)));
 }