Created
March 18, 2019 10:54
-
-
Save YevgeniyShunevych/ecb66d0a872eb3325ab32b718094f0a1 to your computer and use it in GitHub Desktop.
How to get Atata control using variable
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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