child class is not inheriting property from parent
Posted: Fri Nov 01, 2013 12:41 pm
Hello,
I have created wrapper of Ranorex.WebElement something like below.
namespace WObject
{
public class WWebElement : Ranorex.WebElement
{
public WWebElement()
: base()
{
}
public WWebElement(Element element)
: base(element)
{
}
public static implicit operator WWebElement(string path)
{
return new WWebElement(path);
}
public static implicit operator WWebElement(Ranorex.Core.Element element)
{
return new WWebElement(element);
}
}
}
When I am using this wrapper like below
WObject.WWebElement controlToEdit = ele.As<WObject.WWebElement>().NextSibling;
it says Cannot implicitly convert type 'Ranorex.WebElement' to 'WObject.WWebElement'. An explicit conversion exists (are you missing a cast?)
Looks like "ele.As<WObject.WWebElement>().NextSibling" is returning parent element (whereas I think it should return child.)
What is the problem here? Why not child 'WObject.WWebElement' has inherited property '.NextSibling'?
Thanks in advance...
I have created wrapper of Ranorex.WebElement something like below.
namespace WObject
{
public class WWebElement : Ranorex.WebElement
{
public WWebElement()
: base()
{
}
public WWebElement(Element element)
: base(element)
{
}
public static implicit operator WWebElement(string path)
{
return new WWebElement(path);
}
public static implicit operator WWebElement(Ranorex.Core.Element element)
{
return new WWebElement(element);
}
}
}
When I am using this wrapper like below
WObject.WWebElement controlToEdit = ele.As<WObject.WWebElement>().NextSibling;
it says Cannot implicitly convert type 'Ranorex.WebElement' to 'WObject.WWebElement'. An explicit conversion exists (are you missing a cast?)
Looks like "ele.As<WObject.WWebElement>().NextSibling" is returning parent element (whereas I think it should return child.)
What is the problem here? Why not child 'WObject.WWebElement' has inherited property '.NextSibling'?
Thanks in advance...