Ecolab.Pages.DialogManager.UpLoadFile C# (CSharp) Method

UpLoadFile() public method

Ups the load file.
public UpLoadFile ( String filePath ) : void
filePath String The file path.
return void
        public void UpLoadFile(String filePath)
        {
            try
            {
                HtmlInputFile input = Telerik.ActiveBrowser.Find.ByName<HtmlInputFile>("uploadimage");
                System.Threading.Thread.Sleep(3000);
                input.Upload(filePath, 3000);
                //HtmlButton btnSave = Telerik.ActiveBrowser.Find.ByAttributes<HtmlButton>("class=btn btn-success");
                //btnSave.Click();
                System.Threading.Thread.Sleep(3000);
                Logger.Info("Clicked on Save Button");
            }
            catch (FileNotFoundException fne)
            {
                Logger.Error("File not found", fne);
            }
        }

Usage Example

示例#1
0
 /// <summary>
 /// Resets the user preferences.
 /// </summary>
 /// <param name="userDetails">The user details.</param>
 public void ResetUserPreferences(string[] userDetails)
 {
     //Set the preferred language
     GetHtmlControl<HtmlSelect>(guiMap, "SelectPreferredLanguage").SelectByText("English US", true);
     //Set the preferred currency 
     GetHtmlControl<HtmlSelect>(guiMap, "SelectPreferredCurrency").SelectByText(userDetails[1], true);
     //Set the Unit of measure
     GetHtmlControl<HtmlSelect>(guiMap, "SelectUOM").SelectByText(userDetails[2], true);
     //Set the flat fee
     GetHtmlControl<HtmlSelect>(guiMap, "SelectBudgetCustomerFlatFee").SelectByText(userDetails[3], true);
     //Set the live time
     GetHtmlControl<HtmlSelect>(guiMap, "SelectDBLiveTimeYears").SelectByText(userDetails[4], true);
     //Set the Database Path
     GetHtmlControl<HtmlInputText>(guiMap, "txtDatabaseExportPath").Text = userDetails[5];
     //Upload the file
     DialogManager fileDialog = new DialogManager(Telerik);
     imagePath = Path.GetFullPath(userDetails[6]);
     fileDialog.UpLoadFile(imagePath);
 }
All Usage Examples Of Ecolab.Pages.DialogManager::UpLoadFile