Reputation: 727
Let's we have the following button declared on the page:
[FindsBy(How = How.Id, Using = "btnUserApply")]
public Button ApplyButton { get; set; }
Is it possible to get programmatically the web element locator Id value? Something like this:
string id = applyButton.GetLocatorValue(How how);
Or I should use reflection?
Upvotes: 1
Views: 1142
Reputation: 779
Yes, it is possible:
string id = applyButton.GetAttribute("id");
You can get every attribute, just write it's name instead of "id".
Upvotes: 1