コード例 #1
0
 /// <summary>
 /// Creates and Add to Browser a especific DialogHandler
 /// </summary>
 /// <param name="context"></param>
 private void ExecuteAttachDialogHandler(IExecutionContext context)
 {
     switch(this.DialogType)
     {
         case DialogHandlerType.SimpleJavaAlert:
             context.AddDialogHandler(this.dialogId, new WatiN.Core.DialogHandlers.AlertDialogHandler());
             break;
         case DialogHandlerType.ConfirmDialog:
             context.AddDialogHandler(this.dialogId, new WatiN.Core.DialogHandlers.ConfirmDialogHandler());
             break;
         case DialogHandlerType.OkDialog:
             context.AddDialogHandler(this.dialogId, new DialogHandlers.OKDialogHandler());
             break;
         default:
             throw new ExecutionException(string.Format(CultureInfo.InvariantCulture, Resource.ExecuteAttachDialogHandlerInvalidValue, this.DialogType));
     }
 }
コード例 #2
0
 /// <summary>
 /// Sets the <see cref="WatiN.Core.FileUpload.FileName">File name</see> for a file upload element
 /// </summary>
 /// <param name="context">The execution context used to execute this command</param>
 private void SetFileName(IExecutionContext context)
 {
     context.AddDialogHandler("fileUploadDialog", new WatiN.Core.DialogHandlers.FileUploadDialogHandler(this.ValueToSet));
     WatiN.Core.FileUpload fileUpload = (FileUpload) this.FindMethod.Execute(context);
     fileUpload.Click();
 }