Is the Finder attribute argument valid i.e. can it actually be used?, I get this compiler error “‘Finder’ is not a valid named attribute argument because it is not a valid attribute parameter type” whenever I try to use it, e.g.
[FindsBy(Finder = By.Id("test").FindElement(By.TagName("iframe")))]
public IWebElement Test{ get; set; }
Has anyone got a working example of using the Finder attribute argument or is this a bug?
see the code:
http://code.google.com/p/selenium/source/browse/trunk/dotnet/src/WebDriver.Support/PageObjects/FindsByAttribute.cs?r=17167#
Also from http://msdn.microsoft.com/en-us/library/aa664615%28VS.71%29.aspx, The types of positional and named parameters for an attribute class are limited to the attribute parameter types, which are:
One of the following types: bool, byte, char, double, float, int, long, short, string.
The type object.
The type System.Type.
An enum type, provided it has public accessibility and the types in which it is nested (if any) also have public accessibility (Section 17.2).
Single-dimensional arrays of the above types.
To my knowledge By isn’t any of above types and so I get the compiler error or am I wrong?
What I am trying to do is get a ckeditor textbox as a WebElement property of a page object like:
[FindsBy(Finder = By.Id("cke_Details").FindElement(By.TagName("iframe")))]
public IWebElement Details { get; set; }
Is there any other way I can achieve this? Thanks for any help
This is a bug in the .NET
FindsByAttributeimplementation. You should not attempt to use theFinderproperty; it will not work at all. Use the following instead:If you need something more complex like the hierarchical find path you mentioned in your question, you could use a find by XPath or CSS selector, like so: