public void OpenDocument(MS2013documents doc) { switch (doc) { case MS2013documents.QA_ReadinessChecklist_v4: try { wait.Until(ExpectedConditions.PresenceOfAllElementsLocatedBy(By.TagName("a"))); SecondTopic.Click(); // this try catch is to expand the topic dropdown if you are on the km workspace // if you're not in the km workspace program wil continue. } catch (Exception e) { } wait.Timeout = TimeSpan.FromSeconds(5); wait.Until(e => WordDoc.Displayed); AutoITDriver.currentWorkingDocTitle = WordDoc.Text; WordDoc.Click(); break; case MS2013documents.SampleAVMetrics: try { wait.Until(ExpectedConditions.PresenceOfAllElementsLocatedBy(By.TagName("a"))); SecondTopic.Click(); // this try catch is to expand the topic dropdown if you are on the km workspace // if you're not in the km workspace program wil continue. } catch (Exception e) { } wait.Timeout = TimeSpan.FromSeconds(5); wait.Until(e => PowerPointDoc.Displayed); AutoITDriver.currentWorkingDocTitle = PowerPointDoc.Text; PowerPointDoc.Click(); break; case MS2013documents.ITMetrics: try { wait.Until(ExpectedConditions.PresenceOfAllElementsLocatedBy(By.TagName("a"))); SecondTopic.Click(); // this try catch is to expand the topic dropdown if you are on the km workspace // if you're not in the km workspace program wil continue. } catch (Exception e) { } wait.Timeout = TimeSpan.FromSeconds(5); wait.Until(e => ExcelDoc.Displayed); AutoITDriver.currentWorkingDocTitle = ExcelDoc.Text; ExcelDoc.Click(); break; default: break; } }
public void OpenDocumentOnline(MS2013documents document, documentType doctype) { switch (document) { case MS2013documents.QA_ReadinessChecklist_v4: while (true) { try { wait.Until(e => Topics.Count >= 2); SecondTopic.Click(); // this try catch is to expand the topic dropdown if you are on the km workspace // if you're not in the km workspace program wil continue. if (WordDoc.Displayed) { break; } } catch (Exception e) { } } OpenDoc(WordDoc, documentType.Word); break; case MS2013documents.SampleAVMetrics: while (true) { try { wait.Until(e => Topics.Count >= 2); SecondTopic.Click(); // this try catch is to expand the topic dropdown if you are on the km workspace // if you're not in the km workspace program wil continue. if (PowerPointDoc.Displayed) { break; } } catch (Exception e) { } } OpenDoc(PowerPointDoc, doctype); break; case MS2013documents.ITMetrics: while (true) { try { wait.Until(e => Topics.Count >= 2); SecondTopic.Click(); // this try catch is to expand the topic dropdown if you are on the km workspace // if you're not in the km workspace program wil continue. if (ExcelDoc.Displayed) { break; } } catch (Exception e) { Console.WriteLine(e.Message); } } OpenDoc(ExcelDoc, doctype); break; case MS2013documents.KnowledgeHub: OpenDoc(WordDocHub, documentType.Word); break; default: break; } }