Skip to content

Instantly share code, notes, and snippets.

@YevgeniyShunevych
Created March 18, 2019 10:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save YevgeniyShunevych/ecb66d0a872eb3325ab32b718094f0a1 to your computer and use it in GitHub Desktop.
Save YevgeniyShunevych/ecb66d0a872eb3325ab32b718094f0a1 to your computer and use it in GitHub Desktop.
How to get Atata control using variable
using Atata;
namespace SomeApp.UITests
{
using _ = SamplePage;
public class SamplePage : Page<_>
{
public Control<_> GetSomeSpecificControl(string text)
{
return Controls.Create<Control<_>>(text, new FindByXPathAttribute($"span[.='{text}']/following-sibling::*"));
}
public Button<_> GetButton(string text)
{
return Controls.Create<Button<_>>(text, new FindByContentAttribute(text));
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment