Setup Menus in Admin Panel

ITeLearn.com

NoSuchElementException: no such element: Unable to locate element | Selenium Automation | Discussions | ITeLearn.com

Forum usage guidelines

  1. Search First.: If you don’t find a similar post, start a new topic. If you find a similar thread and still have a question, reply to that topic. Duplicate threads will be ignored/deleted without warning.
  2. Proper Subject: Ensure you choose a very appropriate topic name. Else it will be tough to get support from other members.
  3. Patience, please: Our Tech team or other members will usually try to respond within 24 hours on weekdays and max within 48 hours on weekends. Sometimes sooner.
  4. Share opinions: Please feel free to reply, add or comment on any ongoing topics. Collective learning will be of great benefit to all.

 
ITeLearn reviews from participants.

Please consider registering
guest

Log In

Lost password?
Advanced Search

— Forum Scope —

  

— Match —

   

— Forum Options —

   

Minimum search word length is 4 characters - maximum search word length is 84 characters

Topic RSS
NoSuchElementException: no such element: Unable to locate element
February 24, 2017
4:47 pm
Kavita Kothule
Member
Forum Posts: 6
Member Since:
January 31, 2017
Offline

package selenium_webdriver;

import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
//import org.openqa.selenium.firefox.FirefoxDriver;

public class WebdriverJava {

static{
System.setProperty(“webdriver.chrome.driver”, “/Users/kavita/selenium/chromedriver/chromedriver”);
//System.setProperty(“webdriver.gecko.driver”, “/Users/kavita/selenium/geckodriver/geckodriver”);
}
public static void main (String[] args){
//WebDriver driver = new FirefoxDriver();
WebDriver driver = new ChromeDriver();
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
driver.get(“http://www.menudesigns.com”);
driver.manage().window().maximize();
driver.findElement(By.linkText(“Contact”)).click();
driver.findElement(By.id(“element_0”)).sendKeys(“Abc Efg”);
driver.close();
}
}

and got error

Starting ChromeDriver 2.25.426935 (820a95b0b81d33e42712f9198c215f703412e1a1) on port 10693
Only local connections are allowed.
Feb 24, 2017 4:40:50 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Attempting bi-dialect session, assuming Postel’s Law holds true on the remote end
Feb 24, 2017 4:40:52 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: OSS
Exception in thread “main” org.openqa.selenium.NoSuchElementException: no such element: Unable to locate element: {“method”:”id”,”selector”:”element_0″}
(Session info: chrome=56.0.2924.87)
(Driver info: chromedriver=2.25.426935 (820a95b0b81d33e42712f9198c215f703412e1a1),platform=Mac OS X 10.12.3 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 30.03 seconds
For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html
Build info: version: ‘3.0.1’, revision: ‘1969d75’, time: ‘2016-10-18 09:48:19 -0700’
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{applicationCacheEnabled=false, rotatable=false, mobileEmulationEnabled=false, networkConnectionEnabled=false, chrome={chromedriverVersion=2.25.426935 (820a95b0b81d33e42712f9198c215f703412e1a1), userDataDir=/var/folders/qx/wkq4x05s3ngdmlrs7t6386qm0000gq/T/.org.chromium.Chromium.GVthKn}, takesHeapSnapshot=true, pageLoadStrategy=normal, databaseEnabled=false, handlesAlerts=true, hasTouchScreen=false, version=56.0.2924.87, platform=MAC, browserConnectionEnabled=false, nativeEvents=true, acceptSslCerts=true, locationContextEnabled=true, webStorageEnabled=true, browserName=chrome, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true}]
Session ID: 48867fadf74d26f743fd49e1579dbe34
*** Element info: {Using=id, value=element_0}
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:216)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:168)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:635)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:368)
at org.openqa.selenium.remote.RemoteWebDriver.findElementById(RemoteWebDriver.java:417)
at org.openqa.selenium.By$ById.findElement(By.java:218)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:360)
at selenium_webdriver.WebdriverJava.main(WebdriverJava.java:23)

Please help. Thank you.

March 8, 2017
8:32 pm
Techhelp
Member
Forum Posts: 1940
Member Since:
October 26, 2012
Offline

Can you add complete path with .exe extention for the chromedriver

Forum Timezone: UTC -8

Most Users Ever Online: 70

Currently Online:
5 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Techhelp: 1940

Manu: 114

Shan Nathan: 80

Palanki sai charan: 67

Userone: 59

Vishal Anand: 53

Archana Sapre: 51

Geetha Reddy: 44

useL: 38

Kavya Vangala: 37

Member Stats:

Guest Posters: 19

Members: 8066

Moderators: 0

Admins: 1

Forum Stats:

Groups: 1

Forums: 22

Topics: 2124

Posts: 5829

Newest Members: Enterprise HoldingsInc, Devasish kar, Anupama Sood, Thrilok Thrilok, HARISH PUTTA, Immanuel Michealraj, Sarvani Uppati, vikas shinde, Jignesh Patel, Swathi Swathi

Administrators: Karthik eLearn (Admin): 49

0 Responses on Discussions"

Main Menu