public void WEBTestLeadToOpportunityBPFSetValue() { using (var xrmBrowser = new Api.Browser(TestSettings.Options)) { xrmBrowser.LoginPage.Login(_xrmUri, _username, _password); //xrmBrowser.GuidedHelp.CloseGuidedHelp(5000); xrmBrowser.Navigation.OpenSubArea("Sales", "Leads"); xrmBrowser.Grid.SwitchView("Open Leads"); xrmBrowser.CommandBar.ClickCommand("New"); List <Field> fields = new List <Field> { new Field() { Id = "firstname", Value = "Test" }, new Field() { Id = "lastname", Value = "Lead" } }; xrmBrowser.ThinkTime(2000); xrmBrowser.Entity.SetValue("subject", "Test API Lead BPF"); xrmBrowser.Entity.SetValue(new CompositeControl() { Id = "fullname", Fields = fields }); xrmBrowser.Entity.SetValue("mobilephone", "555-555-5555"); xrmBrowser.Entity.SetValue("description", "Test lead creation with API commands"); xrmBrowser.ThinkTime(2000); xrmBrowser.BusinessProcessFlow.SetValue(new LookupItem { Name = "parentaccountid", Value = "Adventure Works (sample)" }); xrmBrowser.ThinkTime(2000); var lookupValue = xrmBrowser.BusinessProcessFlow.GetValue(new LookupItem { Name = "parentaccountid" }); // Set Value of a Textbox field in a Business Process Flow xrmBrowser.BusinessProcessFlow.SetValue("Description", "Test description value in BPF"); xrmBrowser.ThinkTime(2000); var textValue = xrmBrowser.BusinessProcessFlow.GetValue("description"); xrmBrowser.BusinessProcessFlow.SetValue(new OptionSet { Name = "purchaseprocess", Value = "Committee" }); xrmBrowser.ThinkTime(2000); var optionValue = xrmBrowser.BusinessProcessFlow.GetValue(new OptionSet { Name = "purchaseprocess" }); xrmBrowser.CommandBar.ClickCommand("Save"); xrmBrowser.ThinkTime(2000); xrmBrowser.CommandBar.ClickCommand("Qualify"); xrmBrowser.Dialogs.QualifyLead(true, 4000); xrmBrowser.ThinkTime(10000); xrmBrowser.BusinessProcessFlow.PreviousStage(); xrmBrowser.ThinkTime(2000); xrmBrowser.BusinessProcessFlow.NextStage(0, 2000); xrmBrowser.ThinkTime(2000); // Set Value on a TwoOption field in a Business Process Flow xrmBrowser.BusinessProcessFlow.SetValue(new TwoOption { Name = "identifycustomercontacts" }); xrmBrowser.ThinkTime(1000); var checkBoxValue = xrmBrowser.BusinessProcessFlow.GetValue(new TwoOption { Name = "identifycustomercontacts" }); xrmBrowser.BusinessProcessFlow.NextStage(); xrmBrowser.ThinkTime(2000); xrmBrowser.BusinessProcessFlow.NextStage(); xrmBrowser.ThinkTime(2000); xrmBrowser.BusinessProcessFlow.SetValue(new DateTimeControl { Name = "finaldecisiondate", Value = DateTime.Parse("01/15/2019") }); xrmBrowser.BusinessProcessFlow.Finish(); xrmBrowser.BusinessProcessFlow.Hide(); xrmBrowser.ThinkTime(3000); } }