not able to get child element using parsed element in js function

+2 votes
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
Dec 20, 2019 in Selenium by navikasingh
• 140 points
46 views

You might be missing on the syntax:

var children =component.findElement(By.xpath(".//*"));

Also do have a look at this thread for element not found exception https://www.edureka.co/community/399/selenium-xpath-error-element-not-found

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Selenium

0 votes
1 answer
0 votes
1 answer

Not able to find web element in Span Tag

Try using class selector also. driver.findElement(By.cssSelector(".login-link")).click(); hash is used ...READ MORE

answered Jun 21, 2018 in Selenium by Samarpit
• 5,870 points
2,563 views
0 votes
1 answer

i am not able to perform this method in selenium driver.get("google")

Hi Sachin, are you getting any errors ...READ MORE

answered May 15, 2019 in Selenium by Abha
• 27,760 points
60 views
0 votes
0 answers
0 votes
1 answer

Not able to upload a file in Selenium Webdriver using python Scripting

Hey Srinivas, you can checkout this code ...READ MORE

answered Sep 10, 2019 in Selenium by Abha
• 27,760 points
525 views
0 votes
1 answer

Not able to use “explicit wait” in my code

To wait until the entire data has ...READ MORE

answered Mar 27, 2018 in Selenium by nsv999
• 5,510 points
123 views
+3 votes
1 answer

Not able to run in chrome

There is a very silly mistake in ...READ MORE

answered May 15, 2018 in Selenium by king_kenny
• 3,690 points
517 views
0 votes
1 answer

How to get next sibling element using XPath and Selenium for Java?

Below code will help you: Try following-sibling axis : WebElement ...READ MORE

answered May 15, 2018 in Selenium by Samarpit
• 5,870 points
7,513 views
0 votes
1 answer

Not able to identify datepicker in chrome for my site "tui.co.uk".

Dear Vamshi, After clicking on the date box ...READ MORE

answered Jun 20, 2018 in Selenium by walter 123
• 240 points
87 views