コード例 #1
0
        /// <summary>
        /// Executes the java dialog get message.
        /// </summary>
        /// <param name="context">The context.</param>
        private void ExecuteGetJavaDialogMessage(IExecutionContext context)
        {
            DialogHandlerHelper dialogHelper = new DialogHandlerHelper();

            switch (this.DialogType)
            {
                case DialogHandlerType.SimpleJavaAlert:
                    AlertDialogHandler handler = context.GetDialogHandler(this.DialogId) as WatiN.Core.DialogHandlers.AlertDialogHandler;

                    if (handler != null)
                    {
                        handler.WaitUntilExists();
                        handler.OKButton.Click();
                        context.LastFoundValue = handler.Message;
                    }
                    else
                    {
                        throw new ExecutionException(string.Format(CultureInfo.InvariantCulture, Resource.ExecuteGetJavaDialogMessageNoIdAdded, this.DialogId));
                    }
                    break;
                default:
                    throw new ExecutionException(string.Format(CultureInfo.InvariantCulture, Resource.ExecuteAttachDialogHandlerInvalidValue, this.DialogType));
            }
        }