public void SetTextBoxTextx10() { // Arrange // ActUIElement actUIElement // Until we will have ActUIElement in GingerCoreNEt we create a fake actions ActBrowserElement actBrowserElement = new ActBrowserElement() { ControlAction = ActBrowserElement.eControlAction.GotoURL, Value = "http://www.facebook.com" }; ExecuteOnPlugin.ExecutePlugInActionOnAgent(agent, actBrowserElement); // Act ActUIElement actUIElementFake = new ActUIElement() { ElementLocateBy = eLocateBy.ByID, ElementLocateValue = "u_0_e", ElementType = eElementType.TextBox, ElementAction = ActUIElement.eElementAction.SetText }; for (int i = 0; i < 10; i++) { actUIElementFake.Value = "#" + i; ExecuteOnPlugin.ExecutePlugInActionOnAgent(agent, actUIElementFake); Assert.IsTrue(string.IsNullOrEmpty(actUIElementFake.Error), "no Error #" + i); } // Assert Assert.IsTrue(string.IsNullOrEmpty(actBrowserElement.Error)); }
public void SetGetTextBoxText() { // Arrange ActBrowserElement actBrowserElement = new ActBrowserElement() { ControlAction = ActBrowserElement.eControlAction.GotoURL, Value = "http://www.facebook.com" }; ActUIElement setTextBoxAction = new ActUIElement() { ElementLocateBy = eLocateBy.ByID, ElementLocateValue = "u_0_e", ElementType = eElementType.TextBox, ElementAction = ActUIElement.eElementAction.SetText, Value = "hello" }; ActUIElement getTextBoxAction = new ActUIElement() { ElementLocateBy = eLocateBy.ByID, ElementLocateValue = "u_0_e", ElementType = eElementType.TextBox, ElementAction = ActUIElement.eElementAction.GetText }; // Act ExecuteOnPlugin.ExecutePlugInActionOnAgent(agent, actBrowserElement); setTextBoxAction.Value = "12345"; ExecuteOnPlugin.ExecutePlugInActionOnAgent(agent, setTextBoxAction); ExecuteOnPlugin.ExecutePlugInActionOnAgent(agent, getTextBoxAction); // Assert Assert.IsTrue(string.IsNullOrEmpty(actBrowserElement.Error)); Assert.IsTrue(string.IsNullOrEmpty(setTextBoxAction.Error)); Assert.IsTrue(string.IsNullOrEmpty(getTextBoxAction.Error)); Assert.AreEqual("Actual", getTextBoxAction.ReturnValues[0].Param); Assert.AreEqual("12345", getTextBoxAction.ReturnValues[0].Actual); }
public void GotoURL() { // Arrange ActBrowserElement actBrowserElementFake = new ActBrowserElement() { ControlAction = ActBrowserElement.eControlAction.GotoURL, Value = "http://www.facebook.com" }; // Act ExecuteOnPlugin.ExecutePlugInActionOnAgent(agent, actBrowserElementFake); // Assert Assert.IsTrue(string.IsNullOrEmpty(actBrowserElementFake.Error)); }
public void StartAgentOnRemoteGingerGrid() { // Arrange Agent agent = new Agent(); agent.AgentType = Agent.eAgentType.Service; agent.ServiceId = "SeleniumChromeService"; agent.StartDriver(); // ActPlugIn actPlugin = new ActPlugIn() { ServiceId = "SeleniumChromeService", ActionId = "StartDriver" }; //Act //GingerNodeProxy.RemoteGridIP = "10.122.168.174"; // cmildev174 //GingerNodeProxy.RemoteGridPort = 15001; // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! //GingerNodeInfo gingerNodeInfo = new GingerNodeInfo() { }; //GingerNodeProxy gingerNodeProxy = new GingerNodeProxy(gingerNodeInfo, true); ActBrowserElement actBrowserElement = new ActBrowserElement(); // actBrowserElement.ControlAction = ActBrowserElement.eControlAction.GotoURL; actBrowserElement.InputValues.Add(new Amdocs.Ginger.Repository.ActInputValue() { Param = nameof(ActBrowserElement.ControlAction), Value = "GotoURL", ValueForDriver = "GotoURL" }); actBrowserElement.ValueForDriver = "http://www.facebook.com"; // agent.RunAction(actBrowserElement); ExecuteOnPlugin.ExecutePlugInActionOnAgent(agent, actBrowserElement); //NewPayLoad actionPayLoad = ExecuteOnPlugin.CreateActionPayload(actPlugin); //NewPayLoad actionResult = gingerNodeProxy.RunAction(actionPayLoad); //ExecuteOnPlugin.ParseActionResult(actionResult, actPlugin); //Assert Assert.AreEqual(RemoteGingerGrid.NodeList.Count, 2); // Assert.AreEqual("A1 Result", actPlugin.ExInfo); }