public void LoadFileWithKeyTest() { // Arrange LoadFileWithKeyTestReset(); DirectoryInfo keyFileInfo = new DirectoryInfo(TestKeyFile); string keyFilePath = keyFileInfo.FullName; // Act // Working in the master form ApplicationSession.FindElementByName("OpenFileButton").Click(); // Save current working file if one is opened try { Thread.Sleep(TimeSpan.FromSeconds(2)); // Wait for 1 second in case save as dialog appears ApplicationSession.FindElementByName("No").Click(); } catch { } Thread.Sleep(TimeSpan.FromSeconds(5)); // Working in the load dialog ApplicationSession.FindElementByClassName("Edit").SendKeys(TargetFileLocation + TestFileGZ); ApplicationSession.FindElementByClassName("Button").FindElementByName("Open").Click(); Thread.Sleep(TimeSpan.FromSeconds(2)); // Working in enter password for file form ApplicationSession.FindElementByName("PasswordEntry").SendKeys("password"); ApplicationSession.FindElementByName("FindKeyFile").Click(); Thread.Sleep(TimeSpan.FromSeconds(2)); // Working in Windows' open file dialog ApplicationSession.FindElementByClassName("Edit").SendKeys(keyFilePath); ApplicationSession.FindElementByClassName("Button").FindElementByName("Open").Click(); Thread.Sleep(TimeSpan.FromSeconds(5)); // Working in enter password for file form ApplicationSession.FindElementByName("Ok").Click(); Thread.Sleep(TimeSpan.FromSeconds(5)); // Assert Assert.AreEqual(FileOP.GetFile(), TestFileCSV); ApplicationSession.FindElementByName("LockButton").Click(); Thread.Sleep(TimeSpan.FromSeconds(2)); ApplicationSession.FindElementByName("Yes").Click(); Thread.Sleep(TimeSpan.FromSeconds(5)); }
public void LoadFileTest() { // Arrange LoadFileTestReset(); // Act // Working in the master form ApplicationSession.FindElementByName("OpenFileButton").Click(); // Save current working file if one is opened try { Thread.Sleep(TimeSpan.FromSeconds(2)); // Wait for 1 second in case save as dialog appears ApplicationSession.FindElementByName("No").Click(); } catch { } Thread.Sleep(TimeSpan.FromSeconds(5)); // Working in the load dialog ApplicationSession.FindElementByClassName("Edit").SendKeys(TargetFileLocation + TestFileGZ); ApplicationSession.FindElementByClassName("Button").FindElementByName("Open").Click(); Thread.Sleep(TimeSpan.FromSeconds(5)); // Working in enter password for file form ApplicationSession.FindElementByName("PasswordEntry").SendKeys("password"); ApplicationSession.FindElementByName("Ok").Click(); Thread.Sleep(TimeSpan.FromSeconds(5)); // Assert Assert.AreEqual(TestFileCSV, FileOP.GetFile()); ApplicationSession.FindElementByName("LockButton").Click(); Thread.Sleep(TimeSpan.FromSeconds(2)); ApplicationSession.FindElementByName("Yes").Click(); Thread.Sleep(TimeSpan.FromSeconds(5)); }