This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[TestMethod] | |
public void JavaScripPopUps() | |
{ | |
this.driver.Navigate().GoToUrl( | |
@"http://www.w3schools.com/js/tryit.asp?filename=tryjs_confirm"); | |
this.driver.SwitchTo().Frame("iframeResult"); | |
IWebElement button = driver.FindElement(By.XPath("/html/body/button")); | |
button.Click(); | |
IAlert a = driver.SwitchTo().Alert(); | |
if (a.Text.Equals("Press a button!")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[TestMethod] | |
public void DragAndDrop() | |
{ | |
this.driver.Navigate().GoToUrl(@"http://loopj.com/jquery-simple-slider/"); | |
IWebElement element = driver.FindElement(By.XPath("//*[@id='project']/p[1]/div/div[2]")); | |
Actions move = new Actions(driver); | |
move.DragAndDropToOffset(element, 30, 0).Perform(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// <copyright file="BlobStorageService.cs" company="Automate The Planet Ltd."> | |
// Copyright 2021 Automate The Planet Ltd. | |
// Unauthorized copying of this file, via any medium is strictly prohibited | |
// Proprietary and confidential | |
// </copyright> | |
// <author>Anton Angelov</author> | |
// <site>https://bellatrix.solutions/</site> | |
using System; | |
using System.Collections.Generic; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
public class Program | |
{ | |
public static void Main() | |
{ | |
Console.WriteLine("Hello Sukhpinder!"); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function genScreenshot() { | |
var canvasImgContentDecoded; | |
html2canvas(document.body, { | |
onrendered: function(canvas) { | |
window.canvasImgContentDecoded = canvas.toDataURL("image/png"); | |
} | |
}); | |
} | |
genScreenshot(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SelectElement selectElement = new SelectElement(driver.FindElement(By.XPath("/html/body/select"))); | |
selectElement.SelectByText("Planet"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IWebDriver firefoxDriver = new FirefoxDriver(); | |
IWebDriver ieDriver = new InternetExlorerDriver(); | |
IWebDriver edgeDriver = new EdgeDriver(); | |
IWebDriver chromeDriver = new ChromeDriver(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[TestMethod] | |
public void OrderDateSortAsc() | |
{ | |
this.driver.Navigate().GoToUrl( | |
@"http://demos.telerik.com/kendo-ui/grid/remote-data-binding"); | |
var kendoGrid = new KendoGrid(this.driver, this.driver.FindElement(By.Id("grid"))); | |
var allItems = this.GetAllItemsFromDb().OrderBy(x => x.OrderDate); | |
var lastOrderDate = allItems.First().OrderDate; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ProfilesIni profile = new ProfilesIni(); | |
FirefoxProfile firefoxProfile = profile.getProfile("xyzProfile"); | |
String downloadFilepath = "c:\\temp"; | |
firefoxProfile.setPreference("browser.download.folderList", 2); | |
firefoxProfile.setPreference("browser.download.dir", downloadFilepath); | |
firefoxProfile.setPreference("browser.download.manager.alertOnEXEOpen", false); | |
firefoxProfile.setPreference("browser.helperApps.neverAsk.saveToDisk", | |
"application/msword, application/binary, application/ris, text/csv, image/png, application/pdf, text/html, text/plain, application/zip, application/x-zip, application/x-zip-compressed, application/download, application/octet-stream")); | |
FirefoxOptions firefoxOptions = new FirefoxOptions(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
public void VerifyFileDownloadChrome() throws IOException { | |
var expectedFilePath = Paths.get("c:\\temp\\Testing_Framework_2015_3_1314_2_Free.exe"); | |
try | |
{ | |
driver.navigate().to("https://www.telerik.com/download-trial-file/v2/telerik-testing-framework"); | |
wait.until(x -> Files.exists(expectedFilePath)); | |
long bytes = Files.size(expectedFilePath); | |
Assert.assertEquals(4326192, bytes); |