private void Select_DeselectByVisibleText(string driverName) { System.Collections.ObjectModel.Collection <PSObject> coll = new System.Collections.ObjectModel.Collection <PSObject>(); coll.Add((new PSObject(Settings.TestFile05Controls1ElementSelect04Value01Name))); //coll.Add((new PSObject(Settings.TestFile05Controls1ElementSelect04VisibleText02Name))); coll.Add((new PSObject(Settings.TestFile05Controls1ElementSelect04Value03Name))); //coll.Add((new PSObject(Settings.TestFile05Controls1ElementSelect04VisibleText04Name))); CmdletUnitTest.TestRunspace.RunAndEvaluateAreEqual( @"$null = Start-SeWebDriver -DriverName '" + driverName + @"' | Enter-SeURL -URL '" + MiddleLevelCode.GetURLFromPath(System.IO.Path.GetFullPath(Settings.TestFile05Controls1)) + @"' | Get-SeWebElement -XPath '" + Settings.TestFile05Controls1ElementSelect04XPath + @"' | Set-SeSelection -All; " + @"$null = Get-SeWebElement -XPath '" + Settings.TestFile05Controls1ElementSelect04XPath + @"' | Set-SeSelection -VisibleText '" + Settings.TestFile05Controls1ElementSelect04Value02Name + @"','" + Settings.TestFile05Controls1ElementSelect04Value04Name + @"' -Deselect; " + @"Get-SeWebElement -XPath '" + Settings.TestFile05Controls1ElementSelect04XPath + //@"' | Get-SeSelection -Selected | %{ $_ | Read-SeWebElementText; };", @"' | Get-SeSelection -Selected | Read-SeWebElementText;", coll); }
private void Ancestors_1(string driverName) { System.Collections.ObjectModel.Collection <PSObject> coll = new System.Collections.ObjectModel.Collection <PSObject>(); //coll.Add((new PSObject(" Value1\r\n Value 2\r\n Value \\3\r\n Value /4\r\n "))); coll.Add((new PSObject("div3\r\nMy first paragraph.\r\nMy second paragraph."))); coll.Add((new PSObject("div2\r\ndiv3\r\nMy first paragraph.\r\nMy second paragraph."))); coll.Add((new PSObject("div1\r\ndiv2\r\ndiv3\r\nMy first paragraph.\r\nMy second paragraph."))); coll.Add((new PSObject("My First Heading\r\ndiv1\r\ndiv2\r\ndiv3\r\nMy first paragraph.\r\nMy second paragraph."))); coll.Add((new PSObject("My First Heading\r\ndiv1\r\ndiv2\r\ndiv3\r\nMy first paragraph.\r\nMy second paragraph."))); // coll.Add((new PSObject("Test results 26.07.2012 16:16 // Value1 // Value 2 // Value \3 // Value /4 // // Value1 // Value 2 // Value \3 // Value /4 // // Value1 // Value 2 // Value \3 // Value /4 // //Value1 Value 2 Value \3 Value /4 // Value1 // Value 2 // Value \3 // Value /4 // //Value1 Value 2 Value \3 Value /4 //Suites:1 Passed:0 Failed:1 Not tested:0 //Scenarios:2 Passed:0 Failed:2 Not tested:0 //Test cases:21 Passed:11 Failed:7 Not tested:3 Time spent:6 seconds //4 cases of non-critical issues are counted as Passed //111 suite1 FAILED //Scenarios:2 Passed:0 Failed:2 Not tested:0 //Test cases:21 Passed:11 Failed:7 Not tested:3 Time spent:6 seconds //description description description description description description description description description description> //))); //coll.Add((new PSObject(Settings.TestFile05Controls1ElementSelect01Value03Name))); //coll.Add((new PSObject(Settings.TestFile05Controls1ElementSelect01Value04Name))); CmdletUnitTest.TestRunspace.RunAndEvaluateAreEqual( @"Start-SeWebDriver -DriverName '" + driverName + @"' | Enter-SeURL -URL '" + MiddleLevelCode.GetURLFromPath(System.IO.Path.GetFullPath(Settings.TestFile06Controls1)) + @"' | Get-SeWebElement -XPath '" + Settings.TestFile06Controls1Element01XPath + //@"' | Get-SeWebElementAncestors | %{ $_ | Read-SeWebElementText; }", @"' | Get-SeWebElementAncestors | Read-SeWebElementText;", coll); }
private void Parent_1(string driverName) { CmdletUnitTest.TestRunspace.RunAndEvaluateAreEqual( @"(Start-SeWebDriver -DriverName '" + driverName + @"' | Enter-SeURL -URL '" + MiddleLevelCode.GetURLFromPath(System.IO.Path.GetFullPath(Settings.TestFile01Result1)) + @"' | Get-SeWebElement -XPath '" + Settings.TestFile01Result1ElementXPath1 + @"' | Get-SeWebElementParent | Read-SeWebElementText).Substring(0,19);", Settings.TestFile01Result1ElementXPath1Answer + "\r\n"); }
private void TestPrm_XPath_WebDriverInput(string driverName) { CmdletUnitTest.TestRunspace.RunAndEvaluateAreEqual( @"Start-SeWebDriver -DriverName '" + driverName + @"' | Enter-SeURL -URL '" + MiddleLevelCode.GetURLFromPath(System.IO.Path.GetFullPath(Settings.TestFile01Result1)) + @"' | Get-SeWebElement -XPath '" + Settings.TestFile01Result1ElementXPath1 + @"' -First | Read-SeWebElementText;", Settings.TestFile01Result1ElementXPath1Answer); }
private void TestPrm_PartialLinkText_WebDriverInput(string driverName) { CmdletUnitTest.TestRunspace.RunAndEvaluateAreEqual( @"Start-SeWebDriver -DriverName '" + driverName + @"' | Enter-SeURL -URL '" + MiddleLevelCode.GetURLFromPath(System.IO.Path.GetFullPath(Settings.TestFile05Controls1)) + @"' | Get-SeWebElement -PartialLinkText '" + Settings.TestFile05Controls1ElementLink02LinkText + @"' -First | Read-SeWebElementText;", Settings.TestFile05Controls1ElementLink02Answer); }
private void TestPrm_Id_3(string driverName) { CmdletUnitTest.TestRunspace.RunAndEvaluateAreEqual( @"$null = Start-SeWebDriver -DriverName '" + driverName + @"' | Enter-SeURL -URL '" + MiddleLevelCode.GetURLFromPath(System.IO.Path.GetFullPath(Settings.TestFile01Result1)) + @"'; Get-SeWebElement -Id '" + Settings.TestFile01Result1ElementId1 + @"' -First | Read-SeWebElementAttribute -AttributeName id;", Settings.TestFile01Result1ElementId1); }
private void Read_WebElement_TagName(string driverName) { CmdletUnitTest.TestRunspace.RunAndEvaluateAreEqual( @"Start-SeWebDriver -DriverName '" + driverName + @"' | Enter-SeURL -URL '" + MiddleLevelCode.GetURLFromPath(System.IO.Path.GetFullPath(Settings.TestFile05Controls1)) + @"' | Get-SeWebElement -Id '" + Settings.TestFile05Controls1ElementButton01Id + @"' | Read-SeWebElementTagName;", "button"); }
private void Read_WebElement_Disabled(string driverName) { CmdletUnitTest.TestRunspace.RunAndEvaluateAreEqual( @"Start-SeWebDriver -DriverName '" + driverName + @"' | Enter-SeURL -URL '" + MiddleLevelCode.GetURLFromPath(System.IO.Path.GetFullPath(Settings.TestFile05Controls1)) + @"' | Get-SeWebElement -XPath '" + Settings.TestFile05Controls1ElementSelect03XPath + @"' | Read-SeWebElementEnabled;", "False"); }
private void WebElement_SendKeys_1(string driverName) { CmdletUnitTest.TestRunspace.RunAndEvaluateAreEqual( @"Start-SeWebDriver -DriverName '" + driverName + @"' | Enter-SeURL -URL '" + MiddleLevelCode.GetURLFromPath(System.IO.Path.GetFullPath(Settings.TestFile05Controls1)) + @"' | Get-SeWebElement -Id '" + Settings.TestFile05Controls1ElementInput01Id + @"' | Set-SeWebElementKeys -Text '" + Settings.TestFile05Controls1ElementInput01Text + @"' | Read-SeWebElementAttribute -AttributeName value;", Settings.TestFile05Controls1ElementInput01Text); }
private void Select_AllOptions_WrongInput(string driverName) { CmdletUnitTest.TestRunspace.RunAndGetTheException( @"Start-SeWebDriver -DriverName '" + driverName + @"' | Enter-SeURL -URL '" + MiddleLevelCode.GetURLFromPath(System.IO.Path.GetFullPath(Settings.TestFile05Controls1)) + @"' | Get-SeWebElement -XPath '" + Settings.TestFile05Controls1ElementButton01XPath + //@"' | Get-SeSelection -All | %{ $_ | Read-SeWebElementText; };", @"' | Get-SeSelection -All | Read-SeWebElementText;", "ParameterBindingException", "A positional parameter cannot be found that accepts argument 'button'."); }
private void TestPrm_TagName_WebElementInput(string driverName) { CmdletUnitTest.TestRunspace.RunAndEvaluateAreEqual( @"Start-SeWebDriver -DriverName '" + driverName + @"' | Enter-SeURL -URL '" + MiddleLevelCode.GetURLFromPath(System.IO.Path.GetFullPath(Settings.TestFile05Controls1)) + @"' | Get-SeWebElement -Id '" + Settings.TestFile05Controls1ElementText02Div + @"' -First | Get-SeWebElement -TagName '" + "text" + @"' -First | Read-SeWebElementText;", Settings.TestFile05Controls1ElementText02Text); }
private void WebElement_Click_1(string driverName) { CmdletUnitTest.TestRunspace.RunAndEvaluateAreEqual( @"$null = Start-SeWebDriver -DriverName '" + driverName + @"' | Enter-SeURL -URL '" + MiddleLevelCode.GetURLFromPath(System.IO.Path.GetFullPath(Settings.TestFile05Controls1)) + @"' | Get-SeWebElement -Id '" + Settings.TestFile05Controls1ElementButton01Id + @"' | Invoke-SeWebElementClick; " + @"Get-SeWebElement -Id '" + Settings.TestFile05Controls1ElementText01Id + @"' | Read-SeWebElementText;", Settings.TestFile05Controls1ElementButton01Answer); }
private void Select_DeselectAllOptions(string driverName) { CmdletUnitTest.TestRunspace.RunAndEvaluateAreEqual( @"$null = Start-SeWebDriver -DriverName '" + driverName + @"' | Enter-SeURL -URL '" + MiddleLevelCode.GetURLFromPath(System.IO.Path.GetFullPath(Settings.TestFile05Controls1)) + @"' | Get-SeWebElement -XPath '" + Settings.TestFile05Controls1ElementSelect04XPath + @"' | Set-SeSelection -Index 2,3; " + @"$null = Get-SeWebElement -XPath '" + Settings.TestFile05Controls1ElementSelect04XPath + @"' | Set-SeSelection -All -Deselect; " + @"if ((Get-SeWebElement -XPath '" + Settings.TestFile05Controls1ElementSelect04XPath + "' | Get-SeSelection -Selected) -ne $null) { \"1\"; } else { \"0\"; }", "0"); }
private void TestPrm_Id_WebDriverInput(string driverName) { System.Collections.ObjectModel.Collection <PSObject> coll = new System.Collections.ObjectModel.Collection <PSObject>(); coll.Add((new PSObject(Settings.TestFile05Controls1ElementLink03Answer))); coll.Add((new PSObject(Settings.TestFile05Controls1ElementLink04Answer))); CmdletUnitTest.TestRunspace.RunAndEvaluateAreEqual( @"Start-SeWebDriver -DriverName '" + driverName + @"' | Enter-SeURL -URL '" + MiddleLevelCode.GetURLFromPath(System.IO.Path.GetFullPath(Settings.TestFile05Controls1)) + @"' | Get-SeWebElement -Id '" + Settings.TestFile05Controls1ElementLinkIds + //@"' | %{ $_ | Read-SeWebElementText; }", @"' | Read-SeWebElementText;", coll); }
private void Select_DeselectAllOptions_WrongInput(string driverName) { CmdletUnitTest.TestRunspace.RunAndGetTheException( @"$null = Start-SeWebDriver -DriverName '" + driverName + @"' | Enter-SeURL -URL '" + MiddleLevelCode.GetURLFromPath(System.IO.Path.GetFullPath(Settings.TestFile05Controls1)) + @"' | Get-SeWebElement -XPath '" + Settings.TestFile05Controls1ElementSelect04XPath + @"' | Set-SeSelection -Index 2,3; " + @"$null = Get-SeWebElement -XPath '" + Settings.TestFile05Controls1ElementSelect04XPath + @"' | Set-SeSelection -All -Deselect; " + @"if ((Get-SeWebElement -XPath '" + Settings.TestFile05Controls1ElementSelect04XPath + "' | Get-SeSelection -Selected) -ne $null) { \"1\"; } else { \"0\"; }", "ParameterBindingException", "A positional parameter cannot be found that accepts argument 'button'."); }
private void Select_AllOptions(string driverName) { System.Collections.ObjectModel.Collection <PSObject> coll = new System.Collections.ObjectModel.Collection <PSObject>(); coll.Add((new PSObject(Settings.TestFile05Controls1ElementSelect01Value01Name))); coll.Add((new PSObject(Settings.TestFile05Controls1ElementSelect01Value02Name))); coll.Add((new PSObject(Settings.TestFile05Controls1ElementSelect01Value03Name))); coll.Add((new PSObject(Settings.TestFile05Controls1ElementSelect01Value04Name))); CmdletUnitTest.TestRunspace.RunAndEvaluateAreEqual( @"Start-SeWebDriver -DriverName '" + driverName + @"' | Enter-SeURL -URL '" + MiddleLevelCode.GetURLFromPath(System.IO.Path.GetFullPath(Settings.TestFile05Controls1)) + @"' | Get-SeWebElement -XPath '" + //Settings.TestFile05Controls1ElementSelect01XPath + Settings.TestFile05Controls1ElementSelect04XPath + //@"' | Get-SeSelection -All | %{ $_ | Read-SeWebElementText; };", @"' | Get-SeSelection -All | Read-SeWebElementText;", coll); }
private void Select_SelectAllOptions_WrongInput(string driverName) { System.Collections.ObjectModel.Collection <PSObject> coll = new System.Collections.ObjectModel.Collection <PSObject>(); coll.Add((new PSObject(Settings.TestFile05Controls1ElementSelect04Value01Name))); coll.Add((new PSObject(Settings.TestFile05Controls1ElementSelect04Value02Name))); coll.Add((new PSObject(Settings.TestFile05Controls1ElementSelect04Value03Name))); coll.Add((new PSObject(Settings.TestFile05Controls1ElementSelect04Value04Name))); CmdletUnitTest.TestRunspace.RunAndGetTheException( @"$null = Start-SeWebDriver -DriverName '" + driverName + @"' | Enter-SeURL -URL '" + MiddleLevelCode.GetURLFromPath(System.IO.Path.GetFullPath(Settings.TestFile05Controls1)) + @"' | Get-SeWebElement -XPath '" + Settings.TestFile05Controls1ElementSelect04XPath + @"' | Set-SeSelection -All; " + @"Get-SeWebElement -XPath '" + Settings.TestFile05Controls1ElementButton01XPath + //@"' | Get-SeSelection -Selected | %{ $_ | Read-SeWebElementText; };", @"' | Get-SeSelection -Selected | Read-SeWebElementText;", "ParameterBindingException", "A positional parameter cannot be found that accepts argument 'button'."); }
public void Ch_PageRefresh_Chrome() { PageRefresh( Settings.DriverNameChrome, MiddleLevelCode.GetURLFromPath(System.IO.Path.GetFullPath(Settings.TestFile05Controls1))); }
public void IE_PageRefresh_IE() { PageRefresh( Settings.DriverNameInternetExplorer, MiddleLevelCode.GetURLFromPath(System.IO.Path.GetFullPath(Settings.TestFile05Controls1))); }
public void IE_NavigateForward_IE() { NavigateForward( Settings.DriverNameInternetExplorer, MiddleLevelCode.GetURLFromPath(System.IO.Path.GetFullPath(Settings.TestFile05Controls1))); }
public void FF_PageRefresh_Firefox() { PageRefresh( Settings.DriverNameFirefox, MiddleLevelCode.GetURLFromPath(System.IO.Path.GetFullPath(Settings.TestFile05Controls1))); }
public void FF_NavigateForward_Firefox() { NavigateForward( Settings.DriverNameFirefox, MiddleLevelCode.GetURLFromPath(System.IO.Path.GetFullPath(Settings.TestFile05Controls1))); }
public void Ch_NavigateForward_Chrome() { NavigateForward( Settings.DriverNameChrome, MiddleLevelCode.GetURLFromPath(System.IO.Path.GetFullPath(Settings.TestFile05Controls1))); }
public void IE_SwitchToFrame_IE() { SwitchToFrame( Settings.DriverNameInternetExplorer, MiddleLevelCode.GetURLFromPath(System.IO.Path.GetFullPath(Settings.TestFile07Frames1))); }
public void IE_SwitchToAlert_confirm_IE() { SwitchToAlert_confirm( Settings.DriverNameInternetExplorer, MiddleLevelCode.GetURLFromPath(System.IO.Path.GetFullPath(Settings.TestFile10Alerts1))); }
public void Ch_SwitchToFrame_Chrome() { SwitchToFrame( Settings.DriverNameChrome, MiddleLevelCode.GetURLFromPath(System.IO.Path.GetFullPath(Settings.TestFile07Frames1))); }
public void FF_SwitchToFrame_Firefox() { SwitchToFrame( Settings.DriverNameFirefox, MiddleLevelCode.GetURLFromPath(System.IO.Path.GetFullPath(Settings.TestFile07Frames1))); }
public void FF_NavigateTo_Firefox() { NavigateTo( Settings.DriverNameFirefox, MiddleLevelCode.GetURLFromPath(System.IO.Path.GetFullPath(Settings.TestFile01Result1))); }
public void IE_NavigateTo_IE() { NavigateTo( Settings.DriverNameInternetExplorer, MiddleLevelCode.GetURLFromPath(System.IO.Path.GetFullPath(Settings.TestFile01Result1))); }
public void Ch_NavigateTo_Chrome() { NavigateTo( Settings.DriverNameChrome, MiddleLevelCode.GetURLFromPath(System.IO.Path.GetFullPath(Settings.TestFile01Result1))); }