Best Ocaramba code snippet using Ocaramba.Tests.NUnitExtentReports.PageObjects.DropdownPage.ElementLocator
InternetPage.cs
Source:InternetPage.cs
...34 private static readonly NLog.Logger Logger = NLog.Web.NLogBuilder.ConfigureNLog("nlog.config").GetCurrentClassLogger();35 /// <summary>36 /// Locators for elements37 /// </summary>38 private readonly ElementLocator39 linkLocator = new ElementLocator(Locator.CssSelector, "a[href='/{0}']"),40 basicAuthLink = new ElementLocator(Locator.XPath, "//a[contains(text(),'Auth')]"),41 dropdownPageByLinkTextLocator = new ElementLocator(Locator.LinkText, "Dropdown"),42 partialLinkTextLocator = new ElementLocator(Locator.PartialLinkText, "Drag");43 public InternetPage(DriverContext driverContext)44 : base(driverContext)45 {46 }47 /// <summary>48 /// Methods for this HomePage49 /// </summary>50 /// <returns>Returns HomePage</returns>51 public InternetPage OpenHomePage()52 {53 var url = BaseConfiguration.GetUrlValue;54 this.Driver.NavigateTo(new Uri(url));55 Logger.Info(CultureInfo.CurrentCulture, "Opening page {0}", url);56 return this;...
DropdownPage.cs
Source:DropdownPage.cs
...28 using Ocaramba.Types;29 using Ocaramba.WebElements;30 public class DropdownPage : ProjectPageBase31 {32 private readonly ElementLocator dropDownLocator = new ElementLocator(33 Locator.Id, "dropdown");34 public DropdownPage(DriverContext driverContext)35 : base(driverContext)36 {37 }38 39 public void SelectByIndex(int index)40 {41 ExtentTestLogger.Debug("DropdownPage: Selecting element on dropdown by index: " + index);42 Select select = this.Driver.GetElement<Select>(this.dropDownLocator, 300);43 select.SelectByIndex(index);44 }45 public void SelectByValue(string value)46 {...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!