2

I am new to Atata framework. When I click a link in my webpage, it opens in a new window. How to switch to the new window using Atata framework? Thanks

Yevgeniy Shunevych
  • 1,136
  • 6
  • 11
DerekR
  • 23
  • 2

1 Answers1

2

You can use Go.ToNextWindow<TPageObject>() method. For example:

Go.To<SomePage>().
    // Do some actions.
    ButtonThatOpensWindow.Click();

Go.ToNextWindow<SomeOtherPage>(). // Switches to newly opened window.
    // Do some actions in scope of new window.
    CloseWindow(); // Closes window and switches back to the previous window.

Go.To<SomePage>(navigate: false)...
   // Continue to work within the first window.

There is also Go.ToWindow<TPageObject>(...) method, which takes the name of the window and can be used for more specific switching between windows if you have more than 2 of them opened at the same time.

Yevgeniy Shunevych
  • 1,136
  • 6
  • 11