How to use BaseConfiguration class of Ocaramba package

Best Ocaramba code snippet using Ocaramba.BaseConfiguration

FormAuthenticationPage.cs

Source:FormAuthenticationPage.cs Github

copy

Full Screen

...27 /// Methods for this HomePage28 /// </summary>29 public string GetMessageSecure()30 {31 var messageSecureText = this.Driver.GetElement(this.messageSecure, ProjectBaseConfiguration.CustomTimeout, e => e.Displayed).Text;32 messageSecureText = messageSecureText.Split('\r')[0];33 Logger.Info(CultureInfo.CurrentCulture, "Message text: {0}", messageSecureText);34 return messageSecureText;35 }36 public void EnterPassword(string password)37 {38 Logger.Info(CultureInfo.CurrentCulture, "Password '{0}'", password);39 this.Driver.GetElement(this.passwordLoc.Format("password"), BaseConfiguration.ShortTimeout).SendKeys(password);40 }41 public void EnterUserName(string userName)42 {43 Logger.Info(CultureInfo.CurrentCulture, "User name '{0}'", userName);44 this.Driver.GetElement(this.userNameLoc.Format("username"), BaseConfiguration.ShortTimeout).SendKeys(userName);45 }46 public void LogIn()47 {48 Logger.Info(CultureInfo.CurrentCulture, "Click on Login Button");49 this.Driver.GetElement(this.loginButtonLoc).Click();50 }51 public bool PageTitle()52 {53 var pageTitle = this.Driver.IsPageTitle("The Internet", 5);54 return pageTitle;55 }56 }57}...

Full Screen

Full Screen

ProjectBaseConfiguration.cs

Source:ProjectBaseConfiguration.cs Github

copy

Full Screen

...6{7 /// <summary>8 /// SeleniumConfiguration that consume app.config file9 /// </summary>10 public static class ProjectBaseConfiguration11 {12 private static readonly string CurrentDirectory = Directory.GetCurrentDirectory();13 /// <summary>14 /// Gets the custom Timeout.15 /// </summary>16 /// <value>17 /// The data driven file.18 /// </value>19 public static int CustomTimeout20 {21 get22 {23 return int.Parse(BaseConfiguration.Builder["appSettings:customTimeout"]);24 }25 }26 /// <summary>27 /// Gets the data driven file.28 /// </summary>29 /// <value>30 /// The data driven file.31 /// </value>32 public static string DataDrivenFile33 {34 get35 {36 if (BaseConfiguration.UseCurrentDirectory)37 {38 return Path.Combine(CurrentDirectory + BaseConfiguration.Builder["appSettings:DataDrivenFile"]);39 }40 return BaseConfiguration.Builder["appSettings:DataDrivenFile"];41 }42 }43 /// <summary>44 /// Gets the Excel data driven file.45 /// </summary>46 /// <value>47 /// The Excel data driven file.48 /// </value>49 public static string DataDrivenFileXlsx50 {51 get52 {53 if (BaseConfiguration.UseCurrentDirectory)54 {55 return Path.Combine(CurrentDirectory + BaseConfiguration.Builder["appSettings:DataDrivenFileXlsx"]);56 }57 return BaseConfiguration.Builder["appSettings:DataDrivenFileXlsx"];58 }59 }60 /// <summary>61 /// Gets the Download Folder path62 /// </summary>63 public static string DownloadFolderPath64 {65 get { return FilesHelper.GetFolder(BaseConfiguration.Builder["appSettings:DownloadFolder"], CurrentDirectory); }66 }67 }68}...

Full Screen

Full Screen

BaseConfiguration

Using AI Code Generation

copy

Full Screen

1using Ocaramba;2using Ocaramba.Extensions;3using Ocaramba.Types;4using NUnit.Framework;5using System;6using System.Collections.Generic;7using System.Linq;8using System.Text;9using System.Threading.Tasks;10using OpenQA.Selenium;11using OpenQA.Selenium.Chrome;12using OpenQA.Selenium.Firefox;13using OpenQA.Selenium.IE;14using OpenQA.Selenium.Remote;15using System.IO;16using System.Reflection;17using System.Threading;18using System.Configuration;19{20 {21 private readonly string baseUrl = ConfigurationManager.AppSettings["BaseUrl"];22 public void TestMethod()23 {24 DriverContext.Driver.Navigate().GoToUrl(this.baseUrl);25 DriverContext.Driver.WaitForPageLoad();26 DriverContext.Driver.Manage().Window.Maximize();27 }28 }29}30using Ocaramba;31using Ocaramba.Extensions;32using Ocaramba.Types;33using NUnit.Framework;34using System;35using System.Collections.Generic;36using System.Linq;37using System.Text;38using System.Threading.Tasks;39using OpenQA.Selenium;40using OpenQA.Selenium.Chrome;41using OpenQA.Selenium.Firefox;42using OpenQA.Selenium.IE;43using OpenQA.Selenium.Remote;44using System.IO;45using System.Reflection;46using System.Threading;47using System.Configuration;48{49 {50 private readonly string browser = ConfigurationManager.AppSettings["Browser"];51 public void OneTimeSetUp()52 {53 switch (this.browser)54 {55 DriverContext.Driver = new InternetExplorerDriver();56 break;57 DriverContext.Driver = new ChromeDriver();58 break;59 DriverContext.Driver = new FirefoxDriver();60 break;61 DriverContext.Driver = new ChromeDriver();62 break;63 }64 }65 public void OneTimeTearDown()66 {67 if (DriverContext.Driver != null)68 {69 DriverContext.Driver.Quit();70 }71 }72 }73}74using Ocaramba;75using Ocaramba.Extensions;76using Ocaramba.Types;77using NUnit.Framework;78using System;

Full Screen

Full Screen

BaseConfiguration

Using AI Code Generation

copy

Full Screen

1using Ocaramba;2using Ocaramba.Extensions;3using Ocaramba.Types;4using OpenQA.Selenium;5using OpenQA.Selenium.Chrome;6using OpenQA.Selenium.Edge;7using OpenQA.Selenium.Firefox;8using OpenQA.Selenium.IE;9using OpenQA.Selenium.Safari;10using System;11using System.Collections.Generic;12using System.Diagnostics;13using System.Drawing.Imaging;14using System.IO;15using System.Linq;16using System.Text;17using System.Threading.Tasks;18using NUnit.Framework;19using System.Threading;20using OpenQA.Selenium.Interactions;21{22 {

Full Screen

Full Screen

BaseConfiguration

Using AI Code Generation

copy

Full Screen

1using Ocaramba;2using Ocaramba.Extensions;3using Ocaramba.Types;4using System;5using System.Collections.Generic;6using System.Linq;7using System.Text;8using System.Threading.Tasks;9using NUnit.Framework;10using OpenQA.Selenium;11using OpenQA.Selenium.Interactions;12using OpenQA.Selenium.Support.UI;13{14 {15 public OcarambaTests()16 : base(DriverContext.Resolution1920x1080)17 {18 }19 public void IsOcarambaLogoVisible()20 {21 var homePage = new HomePage(DriverContext);22 homePage.OpenHomePage();23 Assert.IsTrue(homePage.IsOcarambaLogoVisible());24 }25 public void IsOcarambaLogoVisible2()26 {27 var homePage = new HomePage(DriverContext);28 homePage.OpenHomePage();29 Assert.IsTrue(homePage.IsOcarambaLogoVisible());30 }31 public void IsOcarambaLogoVisible3()32 {33 var homePage = new HomePage(DriverContext);34 homePage.OpenHomePage();35 Assert.IsTrue(homePage.IsOcarambaLogoVisible());36 }37 public void IsOcarambaLogoVisible4()38 {

Full Screen

Full Screen

BaseConfiguration

Using AI Code Generation

copy

Full Screen

1using Ocaramba;2using Ocaramba.Extensions;3using NUnit.Framework;4using System;5using System.Collections.Generic;6using System.Linq;7using System.Text;8using System.Threading.Tasks;9using System.Threading;10using System.IO;11using OpenQA.Selenium;12using OpenQA.Selenium.Chrome;13using OpenQA.Selenium.Support.UI;14using System.Reflection;15using System.Diagnostics;16{17 {18 public BaseTest()19 {20 this.DriverContext = new DriverContext();21 }22 public DriverContext DriverContext { get; set; }23 {24 {25 return this.DriverContext.Driver;26 }27 {28 this.DriverContext.Driver = value;29 }30 }31 {32 {33 return this.DriverContext.Browser;34 }35 {36 this.DriverContext.Browser = value;37 }38 }39 public TestContext TestContext { get; set; }40 public string PageObject { get; set; }41 public string TestObject { get; set; }42 public string TestCaseId { get; set; }43 public string TestCaseName { get; set; }44 public string TestCaseDescription { get; set; }

Full Screen

Full Screen

BaseConfiguration

Using AI Code Generation

copy

Full Screen

1using Ocaramba;2using Ocaramba.Extensions;3using Ocaramba.Types;4using System;5using System.Collections.Generic;6using System.Linq;7using System.Text;8using System.Threading.Tasks;9using NUnit.Framework;10{11 {12 public Test1(DriverContext driverContext) : base(driverContext)13 {14 }15 public void TestMethod1()16 {17 var driver = this.DriverContext.Driver;18 driver.FindElement(By.Name("q")).SendKeys("Hello");19 driver.FindElement(By.Name("btnK")).Click();20 driver.WaitForPageLoad();21 }22 }23}24using Ocaramba;25using Ocaramba.Extensions;26using Ocaramba.Types;27using System;28using System.Collections.Generic;29using System.Linq;30using System.Text;31using System.Threading.Tasks;32using NUnit.Framework;33{34 {35 public Test1(DriverContext driverContext) : base(driverContext)36 {37 }38 public void TestMethod1()39 {40 var driver = this.DriverContext.Driver;41 driver.FindElement(By.Name("q")).SendKeys("Hello");42 driver.FindElement(By.Name("btnK")).Click();43 driver.WaitForPageLoad();44 }45 }46}47using Ocaramba;48using Ocaramba.Extensions;49using Ocaramba.Types;50using System;51using System.Collections.Generic;52using System.Linq;53using System.Text;54using System.Threading.Tasks;55using NUnit.Framework;56{57 {58 public Test2(DriverContext driverContext) : base(driverContext)59 {60 }61 public void TestMethod1()62 {63 var driver = this.DriverContext.Driver;64 driver.Navigate().GoToUrl("https

Full Screen

Full Screen

BaseConfiguration

Using AI Code Generation

copy

Full Screen

1using Ocaramba;2using Ocaramba.Extensions;3using Ocaramba.Types;4using NUnit.Framework;5using OpenQA.Selenium;6using OpenQA.Selenium.Remote;7using System;8using System.Collections.Generic;9using System.Diagnostics;10using System.Drawing;11using System.Drawing.Imaging;12using System.IO;13using System.Linq;14using System.Text;15{16 [Parallelizable(ParallelScope.Fixtures)]17 {18 public BaseTest(DriverContext driverContext) : base(driverContext)19 {20 }21 public void SetupTest()22 {23 DriverContext.Driver.Manage().Window.Maximize();24 DriverContext.Driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(30);25 }26 public void TearDown()27 {28 if (TestContext.CurrentContext.Result.Outcome.Status == NUnit.Framework.Interfaces.TestStatus.Failed)29 {30 var test = TestContext.CurrentContext.Test.Name;31 var directory = Path.Combine(Environment.CurrentDirectory, "TestResults");32 Directory.CreateDirectory(directory);33 var path = Path.Combine(directory, test + ".png");34 DriverContext.Driver.TakeScreenshot(path);35 TestContext.AddTestAttachment(path);36 }37 }38 }39}40using Ocaramba;41using Ocaramba.Extensions;42using Ocaramba.Types;43using NUnit.Framework;44using OpenQA.Selenium;45using OpenQA.Selenium.Remote;46using System;47using System.Collections.Generic;48using System.Diagnostics;49using System.Drawing;50using System.Drawing.Imaging;51using System.IO;52using System.Linq;53using System.Text;54{55 [Parallelizable(ParallelScope.Fixtures)]56 {57 public BaseTest(DriverContext driverContext) : base(driverContext)58 {59 }60 public void SetupTest()61 {62 DriverContext.Driver.Manage().Window.Maximize();63 DriverContext.Driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(30);64 }65 public void TearDown()66 {67 if (TestContext.CurrentContext.Result.Outcome.Status == NUnit.Framework.Interfaces.TestStatus.Failed)68 {69 var test = TestContext.CurrentContext.Test.Name;70 var directory = Path.Combine(Environment.CurrentDirectory

Full Screen

Full Screen

BaseConfiguration

Using AI Code Generation

copy

Full Screen

1using Ocaramba;2using Ocaramba.Extensions;3using Ocaramba.Types;4{5 {6 public BaseConfiguration()7 {8 this.DriverType = BrowserType.Chrome;9 this.PageLoadTimeout = 30;10 this.ImplicitWait = 30;11 this.ElementWaitTimeout = 30;12 this.ScreenshotPath = @"C:\Users\Public\Documents\Ocaramba\Screenshots\";13 this.ScreenshotMode = ScreenshotMode.All;14 this.HighlightMode = HighlightMode.All;15 this.HighlightColor = "red";16 this.HighlightDuration = 1;17 }18 }19}20using Ocaramba;21using Ocaramba.Tests;22using NUnit.Framework;23{24 {25 }26}27using Ocaramba;28using Ocaramba.Tests;29using NUnit.Framework;30{31 {32 public BasePage(DriverContext driverContext) : base(driverContext)33 {34 }35 }36}37using Ocaramba;38using Ocaramba.Extensions;39using Ocaramba.Types;40using Ocaramba.Tests;41{42 {43 public BasePage(DriverContext driverContext) : base(driverContext)44 {45 }46 }47}48using Ocaramba;49using Ocaramba.Extensions;50using Ocaramba.Types;51using Ocaramba.Tests;52using NUnit.Framework;53{54 {55 public BasePage(DriverContext driverContext) : base(driverContext)56 {57 }58 }59}60using Ocaramba;61using Ocaramba.Extensions;62using Ocaramba.Types;

Full Screen

Full Screen

Automation Testing Tutorials

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.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run Ocaramba automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Most used methods in BaseConfiguration

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful