public void ClickTry() { var tryBtn = GraphBrowser.Driver.FindElement(By.Id("invokeurlBtn")); GraphBrowser.Click(tryBtn); //if (Browser.Driver.FindElement(By.Id("responseBody")) != null) //{ // Browser.Wait(TimeSpan.FromSeconds(3)); //} // var wait = new WebDriverWait(Browser.Driver as IWebDriver, TimeSpan.FromSeconds(5)); //wait.Until(d => d.FindElement(By.Id("response-container"))); //WebDriverWait wait = new WebDriverWait((Browser.Driver as IWebDriver), TimeSpan.FromSeconds(10)); //IWebElement responseContainer = wait.Until(d => //{ // return d.FindElement(By.Id("response-container")); //}); try { var action = new Actions(GraphBrowser.Driver as IWebDriver); var responseContainer = GraphBrowser.Driver.FindElement(By.Id("response-container")); action.MoveToElement(responseContainer); action.Perform(); } catch (Exception) { { } throw; } }
public void ChooseService(ServiceToTry serviceToTry) { if (!GraphBrowser.Url.Contains("/quick-start")) { GraphBrowser.Goto(GraphUtility.RemoveRedundantPartsfromExtractBaseAddress() + "/quick-start#try-it-out"); } int serviceIndex = (int)serviceToTry; string serviceSuffix = string.Empty; switch (serviceToTry) { case ServiceToTry.GetContacts: serviceSuffix = "-get-contacts"; break; case ServiceToTry.GetEvents: serviceSuffix = "-get-calendars"; break; case ServiceToTry.GetFiles: serviceSuffix = "-get-files"; break; case ServiceToTry.GetGroups: serviceSuffix = "-get-groups"; break; case ServiceToTry.GetMessages: serviceSuffix = "-get-mails"; break; case ServiceToTry.GetUsers: serviceSuffix = "-get-users"; break; default: break; } //var service = GraphBrowser.Driver.FindElement(By.Id("serviceOption"+serviceIndex)); var service = GraphBrowser.Driver.FindElement(By.Id("serviceOption" + serviceSuffix)); GraphBrowser.Click(service); currentSerivce = serviceToTry; }
public void DownloadCode() { var downloadBtn = GraphBrowser.Driver.FindElement(By.Id("downloadCodeSampleButtonRest")); GraphBrowser.Click(downloadBtn); // Give 3 seconds for download to finish before checking for postdownload instructions GraphBrowser.Wait(TimeSpan.FromSeconds(int.Parse(GraphUtility.GetConfigurationValue("WaitTime")))); }
public void ChoosePlatform(Platform platformName) { if (!GraphBrowser.Url.Contains("/quick-start")) { GraphBrowser.Goto(GraphUtility.RemoveRedundantPartsfromExtractBaseAddress() + "/quick-start#setup"); } //To account for iOS_Swift and iOS_Objective_C enums, since enum cannot contain - character but the div IDs contain - var platform = GraphBrowser.Driver.FindElement(By.Id("option-" + platformName.ToString().ToLower().Replace("_", "-"))); GraphBrowser.Click(platform); // Need refactor: Sometimes case failed for the platform setup text is not changed in time GraphBrowser.Wait(TimeSpan.FromSeconds(2)); }