Chropath extension doesnot comes in this webpage

0 votes

Hi All,

I'm unable to locate Chropath extension for locating elements by.xpath. But chropath comes in Chromebrowser. Any solution

Sending  script.

driver.get("http://www.trycatchclasses.com/code/demo/angular4_crud/");

driver.manage().window().maximize();

//************Submitting Student data*****************//

driver.findElement(By.name("name")).sendKeys("John");

driver.findElement(By.name("contact")).sendKeys("123456");

Select drpsubject=new Select(driver.findElement(By.name("subject")));

drpsubject.selectByVisibleText("JS");

driver.findElement(By.name("marks")).sendKeys("100");

driver.findElement(By.cssSelector("input[type=button]")).click();

//********Verify data in the table after submitting***********

WebElement table=driver.findElement(By.xpath("//table[@class='table table-bordered']"));

String name=table.findElement(By.xpath("//td[2]")).getText();

     String contact=table.findElement(By.xpath("//td[3]")).getText();

     String subject=table.findElement(By.xpath("td[4]")).getText();

     String marks=table.findElement(By.xpath("//td[5]")).getText();

     String edit=table.findElement(By.xpath("//td[6]")).getText();

String delete=table.findElement(By.xpath("//td[7]")).getText();

if(name.equals("John") && contact.equals("123456") && subject.equals("JS") && marks.equals("100"))

{

System.out.println("Submit student data - Passed");

}

else

{

System.out.println("Submit student data - Failed");

}

xception in thread "main" org.openqa.selenium.NoSuchElementException: no such element: Unable to locate element: {"method":"xpath","selector":"td[4]"}

  (Session info: chrome=87.0.4280.66)

For documentation on this error, please visit: https://www.seleniumhq.org/exceptions/no_such_element.html

Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:48'

System info: host: 'DESKTOP-D0DRPFI', ip: '192.168.1.72', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '15.0.1'

Driver info: org.openqa.selenium.chrome.ChromeDriver

Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 87.0.4280.66, chrome: {chromedriverVersion: 86.0.4240.22 (398b0743353ff..., userDataDir: C:\Users\mailf\AppData\Loca...}, goog:chromeOptions: {debuggerAddress: localhost:58402}, javascriptEnabled: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: WINDOWS, platformName: WINDOWS, proxy: Proxy(), setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify, webauthn:virtualAuthenticators: true}

Session ID: a5a3997e69ce1f4e31abe6ee218ed6c2

*** Element info: {Using=xpath, value=td[4]}

at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:64)

at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)

at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:481)
Dec 2, 2020 in Selenium by faha
• 380 points

edited Dec 2, 2020 by Niroj 119 views

Hi, @Faha,

You should wait for page load after click on button,so for that write below code :

WebElement element;
Webdriver driver;
WebDriverWait wait = new WebDriverWait(driver, 100);
element= wait.until(ExpectedConditions.elementToBeClickable(By.id("usrUtils")));

1 answer to this question.

0 votes

@Faha

You have to install that extension

answered Dec 4, 2020 by Bindu

Related Questions In Selenium

0 votes
1 answer

What purpose does this "::" solve in selenium?

Well this is not a Selenium functionality, ...READ MORE

answered Apr 18, 2018 in Selenium by king_kenny
• 3,710 points
111 views
0 votes
1 answer
0 votes
1 answer

How to eliminate this error”Cannot instantiate the type Select in selenium webdriver”

Try below code. Select sc = new Select(driver.findElement(By.xpath("your ...READ MORE

answered May 18, 2018 in Selenium by Samarpit
• 5,890 points
6,412 views
+1 vote
2 answers

Is it possible to scroll down in a webpage using selenium webdriver programmed on python?

I using next code for facebook for ...READ MORE

answered May 16, 2019 in Selenium by mslavikas@gmail.com
23,234 views
0 votes
2 answers

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,500 points
5,885 views
0 votes
2 answers

Problem while using InternetExplorerDriver in Selenium WebDriver

enable trusted connection  in internet explorer by ...READ MORE

answered Aug 31, 2020 in Selenium by Sri
• 3,190 points
6,367 views
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,890 points
3,993 views
0 votes
2 answers

How to use such xpath to find web elements

xpath are two types. 1) Absolute XPath:    /html/b ...READ MORE

answered Sep 2, 2020 in Selenium by Sri
• 3,190 points
4,945 views
0 votes
3 answers

Chropath gets disappeared even after pinning in the browser

@Faha Try writing manually.. why depending on such ...READ MORE

answered Dec 4, 2020 in Selenium by Nikita
681 views
0 votes
1 answer