Пример #1
0
        public LocateElementResponse Post(LocateElementRequest request)
        {
            var session = _sessionRepository.GetById(request.SessionId);

            if (String.IsNullOrEmpty(request.Using) || String.IsNullOrEmpty(request.Value))
            {
                throw new MissingCommandParameterException();
            }

            var elementId = _automationService.FindElement(session, request.Using, request.Value, request.ElementId);
            var status    = elementId.HasValue ? StatusCode.Success : StatusCode.NoSuchElement;

            return(new LocateElementResponse(session, elementId)
            {
                Status = status
            });
        }