I wrote below javascript code to fetch child object on a page.
component is parent element and data is test data.But no matter what i try in findelement getting error -either element no found or page or by is not defined.
Div.prototype.nele=function(component,data)
{
var children =component.findElement(By.xpath(".//*));
if(children.length!=0){
for(var ele in eles)
{
if(ele!=null){
if(ele.getText()==data.get("text")){
console.log("pass")
break;
}
}
}
}
Please help me with this function, especially find element path where i am getting error