Represents any HTML element. Default search finds the first occurring element.

<div id="open-button">Open</div>

Supports [GoTemporarily] settings attribute.

Clickable Control

using Atata;
using _ = SampleApp.SamplePage;

namespace SampleApp
{
    public class SamplePage : Page<_>
    {
        [FindById("open-button")]
        public Clickable<_> OpenButton { get; private set; }
    }
}
Go.To<SamplePage>().
    OpenButton.Click();

Clickable Delegate

using Atata;
using _ = SampleApp.SamplePage;

namespace SampleApp
{
    public class SamplePage : Page<_>
    {
        [FindById("open-button")]
        public ClickableDelegate<_> Open { get; private set; }
    }
}
Go.To<SamplePage>().
    Open();

As it is a delegate type, the use of Should, Content and IsEnabled properties should be performed like methods (extensions), e.g. Open.Should().Exist().

Navigation

It is possible to pass another gereric argument of PageObject type, meaning that after the click the navigation to this PageObject should be performed. Works the same way for the control and delegate.

using Atata;
using _ = SampleApp.ItemsPage;

namespace SampleApp
{
    public class ItemsPage : Page<_>
    {
        public ClickableDelegate<ItemPage, _> Open { get; private set; }
    }
}
using Atata;
using _ = SampleApp.ItemPage;

namespace SampleApp
{
    public class ItemPage : Page<_>
    {
        public Clickable<ItemsPage, _> GoBack { get; private set; }
    }
}
Go.To<SamplePage1>().
    Open().
        GoBack.ClickAndGo();

Note that Open delegate property is being used as the method that returns the instance of ItemPage class. But for GoBack property it is needed to call ClickAndGo method as it is a property of Clickable class type.

Methods

public static TNavigateTo

ClickAndGo<TNavigateTo, TOwner>(this INavigable<TNavigateTo, TOwner> navigableControl)

where TNavigateTo : PageObject<TNavigateTo> where TOwner : PageObject<TOwner>

Clicks the control and performs the navigation to the page object of TNavigateTo type.