Example #1
0
        public Drivers.CommunicationProtocol.PayLoad GetPayLoad(ElementLocator elementLocator = null)
        {
            string payLoadName = @"UIElementAction";

            if (Convert.ToBoolean(this.GetInputParamValue(Fields.IsWidgetsElement)))
            {
                payLoadName = @"WidgetsUIElementAction";
            }
            PayLoad PL = new PayLoad(payLoadName);
            // Make it generic function in Act.cs to be used by other actions
            List <PayLoad> PLParams = new List <PayLoad>();

            foreach (ActInputValue AIV in this.InputValues)
            {
                if (!string.IsNullOrEmpty(AIV.Value))
                {
                    PayLoad AIVPL = new PayLoad("AIV", AIV.Param, AIV.ValueForDriver);
                    PLParams.Add(AIVPL);
                }
            }
            PL.AddListPayLoad(PLParams);

            //for Java POM Element
            if (elementLocator != null)
            {
                PL.AddKeyValuePair(elementLocator.LocateBy.ToString(), elementLocator.LocateValue);
            }

            PL.ClosePackage();

            return(PL);
        }