How to use AtataNavigator method of Atata.AtataNavigator class

Best Atata code snippet using Atata.AtataNavigator.AtataNavigator

AtataContext.cs

Source:AtataContext.cs Github

copy

Full Screen

...45 public static readonly TimeSpan DefaultRetryInterval = TimeSpan.FromSeconds(0.5);4647 internal AtataContext()48 {49 Go = new AtataNavigator(this);50 }5152 /// <summary>53 /// Gets or sets the current context.54 /// </summary>55 public static AtataContext Current56 {57 get58 {59 return ModeOfCurrent == AtataContextModeOfCurrent.ThreadStatic60 ? s_currentThreadStaticContext61 : ModeOfCurrent == AtataContextModeOfCurrent.AsyncLocal62 ? s_currentAsyncLocalContext.Value63 : s_currentStaticContext;64 }6566 set67 {68 if (ModeOfCurrent == AtataContextModeOfCurrent.ThreadStatic)69 s_currentThreadStaticContext = value;70 else if (ModeOfCurrent == AtataContextModeOfCurrent.AsyncLocal)71 s_currentAsyncLocalContext.Value = value;72 else73 s_currentStaticContext = value;74 }75 }7677 /// <summary>78 /// Gets or sets the mode of <see cref="Current"/> property.79 /// The default value is <see cref="AtataContextModeOfCurrent.AsyncLocal"/>.80 /// </summary>81 public static AtataContextModeOfCurrent ModeOfCurrent82 {83 get => s_modeOfCurrent;84 set85 {86 s_modeOfCurrent = value;8788 RetrySettings.ThreadBoundary = value == AtataContextModeOfCurrent.ThreadStatic89 ? RetrySettingsThreadBoundary.ThreadStatic90 : value == AtataContextModeOfCurrent.AsyncLocal91 ? RetrySettingsThreadBoundary.AsyncLocal92 : RetrySettingsThreadBoundary.Static;93 }94 }9596 /// <summary>97 /// Gets the global configuration.98 /// </summary>99 public static AtataContextBuilder GlobalConfiguration { get; } = new AtataContextBuilder(new AtataBuildingContext());100101 /// <summary>102 /// Gets the build start local date and time.103 /// Contains the same value for all the tests being executed within one build.104 /// </summary>105 public static DateTime? BuildStart { get; private set; }106107 /// <summary>108 /// Gets the build start UTC date and time.109 /// Contains the same value for all the tests being executed within one build.110 /// </summary>111 public static DateTime? BuildStartUtc { get; private set; }112113 // TODO: Review BuildStartInTimeZone property.114 internal DateTime BuildStartInTimeZone { get; private set; }115116 internal IDriverFactory DriverFactory { get; set; }117118 /// <summary>119 /// Gets the driver.120 /// </summary>121 public IWebDriver Driver122 {123 get124 {125 switch (DriverInitializationStage)126 {127 case AtataContextDriverInitializationStage.Build:128 return _driver;129 case AtataContextDriverInitializationStage.OnDemand:130 if (_driver is null)131 InitDriver();132 return _driver;133 default:134 return null;135 }136 }137 }138139 /// <summary>140 /// Gets a value indicating whether this instance has <see cref="Driver"/> instance.141 /// </summary>142 public bool HasDriver => _driver != null;143 /// <summary>144 /// Gets the driver alias.145 /// </summary>146 public string DriverAlias { get; internal set; }147148 /// <summary>149 /// Gets the driver initialization stage.150 /// </summary>151 public AtataContextDriverInitializationStage DriverInitializationStage { get; internal set; }152 /// <summary>153 /// Gets the instance of the log manager.154 /// </summary>155 public ILogManager Log { get; internal set; }156157 /// <summary>158 /// Gets the name of the test.159 /// </summary>160 public string TestName161 {162 get => _testName;163 internal set164 {165 _testName = value;166 TestNameSanitized = value.SanitizeForFileName();167 }168 }169170 /// <summary>171 /// Gets the name of the test sanitized for file path/name.172 /// </summary>173 public string TestNameSanitized { get; private set; }174175 /// <summary>176 /// Gets the name of the test suite (fixture/class).177 /// </summary>178 public string TestSuiteName179 {180 get => _testSuiteName;181 internal set182 {183 _testSuiteName = value;184 TestSuiteNameSanitized = value.SanitizeForFileName();185 }186 }187188 /// <summary>189 /// Gets the name of the test suite sanitized for file path/name.190 /// </summary>191 public string TestSuiteNameSanitized { get; private set; }192193 /// <summary>194 /// Gets the test suite (fixture/class) type.195 /// </summary>196 public Type TestSuiteType { get; internal set; }197198 /// <summary>199 /// Gets the local date/time of the start.200 /// </summary>201 public DateTime StartedAt { get; private set; }202203 /// <summary>204 /// Gets the UTC date/time of the start.205 /// </summary>206 public DateTime StartedAtUtc { get; private set; }207208 /// <summary>209 /// Gets the time zone.210 /// The default value is <see cref="TimeZoneInfo.Local"/>.211 /// </summary>212 public TimeZoneInfo TimeZone { get; internal set; }213214 /// <summary>215 /// Gets or sets the base URL.216 /// </summary>217 public string BaseUrl { get; set; }218219 /// <summary>220 /// Gets the base retry timeout.221 /// The default value is <c>5</c> seconds.222 /// </summary>223 public TimeSpan BaseRetryTimeout { get; internal set; }224225 /// <summary>226 /// Gets the base retry interval.227 /// The default value is <c>500</c> milliseconds.228 /// </summary>229 public TimeSpan BaseRetryInterval { get; internal set; }230231 /// <summary>232 /// Gets the element find timeout.233 /// The default value is <c>5</c> seconds.234 /// </summary>235 public TimeSpan ElementFindTimeout { get; internal set; }236237 /// <summary>238 /// Gets the element find retry interval.239 /// The default value is <c>500</c> milliseconds.240 /// </summary>241 public TimeSpan ElementFindRetryInterval { get; internal set; }242243 /// <summary>244 /// Gets the waiting timeout.245 /// The default value is <c>5</c> seconds.246 /// </summary>247 public TimeSpan WaitingTimeout { get; internal set; }248249 /// <summary>250 /// Gets the waiting retry interval.251 /// The default value is <c>500</c> milliseconds.252 /// </summary>253 public TimeSpan WaitingRetryInterval { get; internal set; }254255 /// <summary>256 /// Gets the verification timeout.257 /// The default value is <c>5</c> seconds.258 /// </summary>259 public TimeSpan VerificationTimeout { get; internal set; }260261 /// <summary>262 /// Gets the verification retry interval.263 /// The default value is <c>500</c> milliseconds.264 /// </summary>265 public TimeSpan VerificationRetryInterval { get; internal set; }266267 /// <summary>268 /// Gets the default control visibility.269 /// The default value is <see cref="Visibility.Any"/>.270 /// </summary>271 public Visibility DefaultControlVisibility { get; internal set; }272273 /// <summary>274 /// Gets the culture.275 /// The default value is <see cref="CultureInfo.CurrentCulture"/>.276 /// </summary>277 public CultureInfo Culture { get; internal set; }278279 /// <summary>280 /// Gets the type of the assertion exception.281 /// The default value is a type of <see cref="AssertionException"/>.282 /// </summary>283 public Type AssertionExceptionType { get; internal set; }284285 /// <summary>286 /// Gets the type of the aggregate assertion exception.287 /// The default value is a type of <see cref="AggregateAssertionException"/>.288 /// The exception type should have public constructor with <c>IEnumerable&lt;AssertionResult&gt;</c> argument.289 /// </summary>290 public Type AggregateAssertionExceptionType { get; internal set; }291292 /// <summary>293 /// Gets the aggregate assertion strategy.294 /// The default value is an instance of <see cref="AtataAggregateAssertionStrategy"/>.295 /// </summary>296 public IAggregateAssertionStrategy AggregateAssertionStrategy { get; internal set; }297298 /// <summary>299 /// Gets the aggregate assertion depth level.300 /// </summary>301 public int AggregateAssertionLevel { get; internal set; }302303 /// <summary>304 /// Gets the strategy for warning assertion reporting.305 /// The default value is an instance of <see cref="AtataWarningReportStrategy"/>.306 /// </summary>307 public IWarningReportStrategy WarningReportStrategy { get; internal set; }308309 /// <summary>310 /// Gets the list of all assertion results.311 /// </summary>312 public List<AssertionResult> AssertionResults { get; } = new List<AssertionResult>();313314 /// <summary>315 /// Gets the list of pending assertion results with <see cref="AssertionStatus.Failed"/> or <see cref="AssertionStatus.Warning"/> status.316 /// </summary>317 public List<AssertionResult> PendingFailureAssertionResults { get; } = new List<AssertionResult>();318319 /// <summary>320 /// Gets the context of the attributes.321 /// </summary>322 public AtataAttributesContext Attributes { get; internal set; }323324 /// <summary>325 /// Gets the <see cref="DirectorySubject"/> of Artifacts directory.326 /// Artifacts directory can contain any files produced during test execution, logs, screenshots, downloads, etc.327 /// The default Artifacts directory path is <c>"{basedir}/artifacts/{build-start:yyyyMMddTHHmmss}{test-suite-name-sanitized:/*}{test-name-sanitized:/*}"</c>.328 /// </summary>329 public DirectorySubject Artifacts { get; internal set; }330331 /// <summary>332 /// Gets the <see cref="AtataNavigator"/> instance,333 /// which provides the navigation functionality between pages and windows.334 /// </summary>335 public AtataNavigator Go { get; }336337 /// <summary>338 /// Gets the current page object.339 /// </summary>340 public UIComponent PageObject { get; internal set; }341342 internal List<UIComponent> TemporarilyPreservedPageObjectList { get; private set; } = new List<UIComponent>();343344 internal bool IsNavigated { get; set; }345346 internal Stopwatch ExecutionStopwatch { get; } = Stopwatch.StartNew();347348 internal Stopwatch PureExecutionStopwatch { get; } = new Stopwatch();349 ...

Full Screen

Full Screen

AtataNavigator.cs

Source:AtataNavigator.cs Github

copy

Full Screen

...4{5 /// <summary>6 /// Represents the navigation functionality between pages and windows.7 /// </summary>8 public class AtataNavigator9 {10 private readonly AtataContext _context;11 /// <summary>12 /// Initializes a new instance of the <see cref="AtataNavigator"/> class.13 /// </summary>14 /// <param name="context">The context.</param>15 public AtataNavigator(AtataContext context)16 {17 _context = context.CheckNotNull(nameof(context));18 }19 /// <summary>20 /// Navigates to the specified page object.21 /// </summary>22 /// <typeparam name="T">The type of the page object.</typeparam>23 /// <param name="pageObject">24 /// The page object.25 /// If set to <see langword="null"/> creates an instance using the default constructor.</param>26 /// <param name="url">The URL.</param>27 /// <param name="navigate">If set to <see langword="true"/> executes page object navigation functionality.</param>28 /// <param name="temporarily">If set to <see langword="true"/> navigates temporarily preserving current page object state.</param>29 /// <returns>The page object.</returns>...

Full Screen

Full Screen

Go.cs

Source:Go.cs Github

copy

Full Screen

...4 /// Provides the navigation functionality between pages and windows.5 /// </summary>6 public static class Go7 {8 /// <inheritdoc cref="AtataNavigator.To{T}(T, string, bool, bool)"/>9 public static T To<T>(T pageObject = null, string url = null, bool navigate = true, bool temporarily = false)10 where T : PageObject<T>11 =>12 ResolveAtataContext().Go.To(pageObject, url, navigate, temporarily);1314 /// <inheritdoc cref="AtataNavigator.ToWindow{T}(T, string, bool)"/>15 public static T ToWindow<T>(T pageObject, string windowName, bool temporarily = false)16 where T : PageObject<T>17 =>18 ResolveAtataContext().Go.ToWindow(pageObject, windowName, temporarily);1920 /// <inheritdoc cref="AtataNavigator.ToWindow{T}(string, bool)"/>21 public static T ToWindow<T>(string windowName, bool temporarily = false)22 where T : PageObject<T>23 =>24 ResolveAtataContext().Go.ToWindow<T>(windowName, temporarily);2526 /// <inheritdoc cref="AtataNavigator.ToNextWindow{T}(T, bool)"/>27 public static T ToNextWindow<T>(T pageObject = null, bool temporarily = false)28 where T : PageObject<T>29 =>30 ResolveAtataContext().Go.ToNextWindow(pageObject, temporarily);3132 /// <inheritdoc cref="AtataNavigator.ToPreviousWindow{T}(T, bool)"/>33 public static T ToPreviousWindow<T>(T pageObject = null, bool temporarily = false)34 where T : PageObject<T>35 =>36 ResolveAtataContext().Go.ToPreviousWindow(pageObject, temporarily);3738 /// <inheritdoc cref="AtataNavigator.ToUrl(string)"/>39 public static void ToUrl(string url) =>40 ResolveAtataContext().Go.ToUrl(url);4142 private static AtataContext ResolveAtataContext() =>43 AtataContext.Current44 ?? AtataContext.Configure().Build();45 }46} ...

Full Screen

Full Screen

AtataNavigator

Using AI Code Generation

copy

Full Screen

1using Atata;2using NUnit.Framework;3{4 {5 public void SetUp()6 {7 Build();8 }9 public void TestMethod()10 {11 ResultLinks.Should.HaveCountGreaterThanOrEqualTo(1);12 }13 public void TearDown()14 {15 AtataContext.Current?.CleanUp();16 }17 }18}19using Atata;20using NUnit.Framework;21{22 {23 public void SetUp()24 {25 Build();26 }27 public void TestMethod()28 {29 ResultLinks.Should.HaveCountGreaterThanOrEqualTo(1);30 }31 public void TearDown()32 {33 AtataContext.Current?.CleanUp();34 }35 }36}37using Atata;38using NUnit.Framework;39{40 {41 public void SetUp()42 {43 Build();44 }45 public void TestMethod()46 {47 ResultLinks.Should.HaveCountGreaterThanOrEqualTo(1);48 }49 public void TearDown()50 {

Full Screen

Full Screen

AtataNavigator

Using AI Code Generation

copy

Full Screen

1{2 {3 public static void GoTo<TPageObject>(string url)4 {5 AtataContext.Current.Driver.Navigate().GoToUrl(url);6 AtataContext.Current.PageObjectFactory.GetPageObject<TPageObject>();7 }8 }9}10using Atata;11{12 {13 public Button<SamplePage> ClickMe { get; private set; }14 }15}16using Atata;17{18 {19 public Button<SamplePage> ClickMe { get; private set; }20 }21}22using Atata;23{24 {25 public Button<SamplePage> ClickMe { get; private set; }26 }27}28using Atata;29{30 {31 public Button<SamplePage> ClickMe { get; private set; }32 }33}34using Atata;35{36 {37 public Button<SamplePage> ClickMe { get; private set; }38 }39}40using Atata;41{42 {43 public Button<SamplePage> ClickMe { get; private set; }44 }45}46using Atata;47{

Full Screen

Full Screen

AtataNavigator

Using AI Code Generation

copy

Full Screen

1using Atata;2using NUnit.Framework;3{4 {5 public void Test()6 {7 Go.To<HomePage>();8 Go.To<LoginPage>();9 Go.To<HomePage>();10 Go.To<LoginPage>();11 Go.To<HomePage>();12 Go.To<LoginPage>();13 Go.To<HomePage>();14 Go.To<LoginPage>();15 Go.To<HomePage>();16 }17 }18}19using Atata;20using NUnit.Framework;21{22 {23 public void Test()24 {

Full Screen

Full Screen

AtataNavigator

Using AI Code Generation

copy

Full Screen

1AtataContext.Current.NavigateTo(url);2AtataContext.Current.Driver.Navigate().Back();3AtataContext.Current.NavigateTo(url);4AtataContext.Current.Driver.Navigate().Forward();5AtataContext.Current.NavigateTo(url);6AtataContext.Current.Driver.Navigate().Refresh();7AtataContext.Current.NavigateTo(url);8AtataContext.Current.NavigateTo(url);9AtataContext.Current.Driver.Navigate().Back();10AtataContext.Current.Driver.Navigate().Forward();11AtataContext.Current.Driver.Navigate().Refresh();12AtataContext.Current.NavigateTo(url);13AtataContext.Current.Driver.Navigate().Back();14AtataContext.Current.Driver.Navigate().Forward();15AtataContext.Current.Driver.Navigate().Refresh();16AtataContext.Current.Driver.Navigate().Back();17AtataContext.Current.Driver.Navigate().Forward();18AtataContext.Current.Driver.Navigate().Refresh();19AtataContext.Current.NavigateTo(url);20AtataContext.Current.Driver.Navigate().Back();21AtataContext.Current.Driver.Navigate().Forward();22AtataContext.Current.Driver.Navigate().Refresh();23AtataContext.Current.Driver.Navigate().Back();24AtataContext.Current.Driver.Navigate().Forward();25AtataContext.Current.Driver.Navigate().Refresh();

Full Screen

Full Screen

AtataNavigator

Using AI Code Generation

copy

Full Screen

1{2 {3 public void _2()4 {5 Go.To<HomePage>()6 .Header.Should.Equal("Atata Framework");7 Go.To<HomePage>()8 .Header.Should.Equal("Atata Framework");9 Go.To<HomePage>()10 .Header.Should.Equal("Atata Framework");11 Go.To<HomePage>()12 .Header.Should.Equal("Atata Framework");13 }14 }15}16{17 {18 public void _3()19 {20 Go.To<HomePage>()21 .Header.Should.Equal("Atata Framework");22 Go.To<HomePage>()23 .Header.Should.Equal("Atata Framework");24 Go.To<HomePage>()25 .Header.Should.Equal("Atata Framework");26 Go.To<HomePage>()27 .Header.Should.Equal("Atata Framework");28 }29 }30}31{32 {33 public void _4()34 {35 Go.To<HomePage>()36 .Header.Should.Equal("Atata Framework");37 Go.To<HomePage>()38 .Header.Should.Equal("Atata Framework");39 Go.To<HomePage>()40 .Header.Should.Equal("Atata Framework");41 Go.To<HomePage>()42 .Header.Should.Equal("Atata Framework");43 }44 }45}46{47 {48 public void _5()49 {50 Go.To<HomePage>()51 .Header.Should.Equal("Atata Framework");52 Go.To<HomePage>()

Full Screen

Full Screen

AtataNavigator

Using AI Code Generation

copy

Full Screen

1using NUnit.Framework;2using OpenQA.Selenium;3using OpenQA.Selenium.Chrome;4using OpenQA.Selenium.Firefox;5using OpenQA.Selenium.IE;6using OpenQA.Selenium.Edge;7using OpenQA.Selenium.Remote;8using System;9using System.Collections.Generic;10using System.Linq;11using System.Text;12using System.Threading.Tasks;13using System.Threading;14using System.IO;15using System.Reflection;16using Atata;17{18 {19 static void Main(string[] args)20 {21 AtataContext.Configure()22 .UseChrome()23 .UseCulture("en-US")24 .UseAllNUnitTestContexts()25 .Build();26 Go.To<GoogleSearchPage>()27 .SearchFor("Selenium");28 }29 }30}31using NUnit.Framework;32using OpenQA.Selenium;33using OpenQA.Selenium.Chrome;34using OpenQA.Selenium.Firefox;35using OpenQA.Selenium.IE;36using OpenQA.Selenium.Edge;37using OpenQA.Selenium.Remote;38using System;39using System.Collections.Generic;40using System.Linq;41using System.Text;42using System.Threading.Tasks;43using System.Threading;44using System.IO;45using System.Reflection;46using Atata;47{48 {49 static void Main(string[] args)50 {51 AtataContext.Configure()52 .UseChrome()53 .UseCulture("en-US")54 .UseAllNUnitTestContexts()55 .Build();56 Go.To<GoogleSearchPage>()57 .SearchFor("Selenium");58 }59 }60}61using NUnit.Framework;

Full Screen

Full Screen

AtataNavigator

Using AI Code Generation

copy

Full Screen

1using NUnit.Framework;2using Atata;3using Atata.Tests;4{5 {6 public void TestMethod2()7 {8 Build();9 AtataContext.Current.AutoSetUp();10 VerifyTitle("Google");11 }12 }13}

Full Screen

Full Screen

AtataNavigator

Using AI Code Generation

copy

Full Screen

1using NUnit.Framework;2using Atata;3using Atata.Tests;4{5 {6 public void TestMethod2()7 {8 Build();9 AtataContext.Current.AutoSetUp();10 VerifyTitle("Google");11 }12 }13}

Full Screen

Full Screen

AtataNavigator

Using AI Code Generation

copy

Full Screen

1using NUnit.Framework;2using OpenQA.Selenium;3using OpenQA.Selenium.Chrome;4using OpenQA.Selenium.Firefox;5using OpenQA.Selenium.IE;6using OpenQA.Selenium.Edge;7using OpenQA.Selenium.Remote;8using System;9using System.Collections.Generic;10using System.Linq;11using System.Text;12using System.Threading.Tasks;13using System.Threading;14using System.IO;15using System.Reflection;16using Atata;17{18 {19 static void Main(string[] args)20 {21 AtataContext.Configure()22 .UseChrome()23 .UseCulture("en-US")24 .UseAllNUnitTestContexts()25 .Build();26 Go.To<GoogleSearchPage>()27 .SearchFor("Selenium");28 }29 }30}31using NUnit.Framework;32using OpenQA.Selenium;33using OpenQA.Selenium.Chrome;34using OpenQA.Selenium.Firefox;35using OpenQA.Selenium.IE;36using OpenQA.Selenium.Edge;37using OpenQA.Selenium.Remote;38using System;39using System.Collections.Generic;40using System.Linq;41using System.Text;42using System.Threading.Tasks;43using System.Threading;44using System.IO;45using System.Reflection;46using Atata;47{48 {49 static void Main(string[] args)50 {51 AtataContext.Configure()52 .UseChrome()53 .UseCulture("en-US")54 .UseAllNUnitTestContexts()55 .Build();56 Go.To<GoogleSearchPage>()57 .SearchFor("Selenium");58 }59 }60}61using NUnit.Framework;

Full Screen

Full Screen

AtataNavigator

Using AI Code Generation

copy

Full Screen

1using NUnit.Framework;2using Atata;3using Atata.Tests;4{5 {6 public void TestMethod2()7 {8 Build();9 AtataContext.Current.AutoSetUp();10 VerifyTitle("Google");11 }12 }13}

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 Atata automation tests on LambdaTest cloud grid

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

Most used method in AtataNavigator

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful