I am trying to locate below link in Selenium Webdriver using Xpath and CSS.
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<tr>
<td class="cspbItmA">
<a class="cspbItm" target="_parent" href="../isp_track.asp?PARENT_MENU=Customer Order">Find Order</a>
</td>
</tr>
But neither of these options, I am unable to run the script and trapped with below exception:
driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
driver.findElement(By.xpath(".//*[#id='cspbGrp0']/table/tbody/tr[2]/td/a")) .click();
Starting ChromeDriver (v2.9.248315) on port 8139 Exception in thread
"main" org.openqa.selenium.NoSuchElementException: no such element
(Session info: chrome=40.0.2214.115) (Driver info:
chromedriver=2.9.248315,platform=Windows NT 6.1 SP1 x86) (WARNING: The
server did not provide any stacktrace information) Command duration or
timeout: 5.06 seconds For documentation on this error, please visit:
http://seleniumhq.org/exceptions/no_such_element.html Build info:
version: '2.42.0', revision:
'5e824302019c86eae9c8c3ca9155e7307b410cf8', time: '2014-05-24
09:48:41' System info: host: 'inl-279930-1', ip: '10.13.174.254',
os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version:
'1.7.0_55' Session ID: 04489825ed0cfc399afa1ffccb838870 Driver info:
org.openqa.selenium.chrome.ChromeDriver Capabilities [{platform=XP,
acceptSslCerts=true, javascriptEnabled=true, browserName=chrome,
chrome={userDataDir=C:\Users\SUBRAM~1\AppData\Local\Temp\scoped_dir11808_15574},
rotatable=false, locationContextEnabled=true, version=40.0.2214.115,
takesHeapSnapshot=true, cssSelectorsEnabled=true,
databaseEnabled=false, handlesAlerts=true,
browserConnectionEnabled=false, nativeEvents=true,
webStorageEnabled=true, applicationCacheEnabled=false,
takesScreenshot=true}] at
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at
org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:193)
at
org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:145)
at
org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:596)
at
org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:349)
at
org.openqa.selenium.remote.RemoteWebDriver.findElementByXPath(RemoteWebDriver.java:446)
at org.openqa.selenium.By$ByXPath.findElement(By.java:357) at
org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:341)
at roll_forward_test.cpe_progression.main(cpe_progression.java:147)
Could you help me to get this fixed, please.
My preference would be to use css over xpath and I would usually write my own selectors. Because it's in a table it can be a little tricky (meaning you may have to traverse from further up) but from the information on screen I'd go for something like:
//by href
driver.findElement(By.cssSelector("a[href='../isp_track.asp?PARENT_MENU=Customer Order']"))
OR
//by class
driver.findElement(By.cssSelector("a.cspbItm"))
Issue identified and it is caused due to the element present inside an iFrame.
When switching to iFrame first, now able to locate the element.
Thank You,
Praveen
Related
I'm looking for a working locator to address a button on a web page.
"Inspecting element" in the code I see :
<input class="ruButton ruBrowse" tabindex="-1" value="Select & Upload File" style="border: 0px dotted;" type="button">
Copying outerhtml I have :
<input tabindex="-1" value="Select & Upload File" class="ruButton ruBrowse" style="border: 0px dotted;" type="button">
I tried the following as xpath locators but these are not OK - I'd like to understand why :
//input[#value='Select & Upload File']
//input[#value='Select & Upload File']
This locator is OK :
driver.findElement(By.xpath("//input[contains(#class,'ruButton ruBrowse') and contains(#type,'button')]")).click();
More details on error log :
1)
driver.get(baseUrl);
driver.findElement(By.xpath("//input[contains(#value,'Select') and contains (#value,'Upload File')]")).click();
Exception in thread "main" org.openqa.selenium.NoSuchElementException: Unable to find element with xpath == //input[contains(#value,'Select') and contains(#value,'Upload File')] (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 297 milliseconds
For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html
Build info: version: 'unknown', revision: '1969d75', time: '2016-10-18 09:43:45 -0700'
System info: host: 'BGC-W7X64T-2082', ip: '10.119.137.75', os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.8.0_112'
Driver info: org.openqa.selenium.ie.InternetExplorerDriver
Capabilities [{browserAttachTimeout=0, ie.enableFullPageScreenshot=true, enablePersistentHover=true, ie.forceCreateProcessApi=false, ie.forceShellWindowsApi=false, pageLoadStrategy=normal, ignoreZoomSetting=false, ie.fileUploadDialogTimeout=3000, version=11, platform=WINDOWS, nativeEvents=true, ie.ensureCleanSession=false, elementScrollBehavior=0, ie.browserCommandLineSwitches=, requireWindowFocus=false, browserName=internet explorer, initialBrowserUrl=http://localhost:2351/, javascriptEnabled=true, ignoreProtectedModeSettings=false, enableElementCacheCleanup=true, unexpectedAlertBehaviour=dismiss}]
Session ID: 4613c6bf-239c-4ccb-b3b3-f1946276e7c7
*** Element info: {Using=xpath, value=//input[contains(#value,'Select') and contains(#value,'Upload File')]}
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
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.findElementByXPath(RemoteWebDriver.java:473)
at org.openqa.selenium.By$ByXPath.findElement(By.java:361)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:360)
at Selenium_And_AutoIt.main(Selenium_And_AutoIt.java:61)
2)
driver.get(baseUrl);
driver.findElement(By.xpath("//input[#value='Select & Upload File']")).click();
Exception in thread "main" org.openqa.selenium.NoSuchElementException: Unable to find element with xpath == //input[#value='Select & Upload File'] (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 281 milliseconds
For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html
Build info: version: 'unknown', revision: '1969d75', time: '2016-10-18 09:43:45 -0700'
System info: host: 'BGC-W7X64T-2082', ip: '10.119.137.75', os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.8.0_112'
Driver info: org.openqa.selenium.ie.InternetExplorerDriver
Capabilities [{browserAttachTimeout=0, ie.enableFullPageScreenshot=true, enablePersistentHover=true, ie.forceCreateProcessApi=false, ie.forceShellWindowsApi=false, pageLoadStrategy=normal, ignoreZoomSetting=false, ie.fileUploadDialogTimeout=3000, version=11, platform=WINDOWS, nativeEvents=true, ie.ensureCleanSession=false, elementScrollBehavior=0, ie.browserCommandLineSwitches=, requireWindowFocus=false, browserName=internet explorer, initialBrowserUrl=http://localhost:21427/, javascriptEnabled=true, ignoreProtectedModeSettings=false, enableElementCacheCleanup=true, unexpectedAlertBehaviour=dismiss}]
Session ID: eb3f9de0-2fc1-41ce-8f15-6947f956c216
*** Element info: {Using=xpath, value=//input[#value='Select & Upload File']}
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
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.findElementByXPath(RemoteWebDriver.java:473)
at org.openqa.selenium.By$ByXPath.findElement(By.java:361)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:360)
at Selenium_And_AutoIt.main(Selenium_And_AutoIt.java:60)
Thank you !
For what it's worth, I've had trouble in the past with using text that has ampersand(s) inside as well. My solution is to use contains instead of "=" and only provide part of the value text, however, this might not be sufficient since there could conceivably be some other element that contains "Upload File" for example. My solution in this case, assuming that the locator as-is is incorrect, would be the following locator:
//input[contains(#value,'Select') and contains(#value,'Upload File')]
it could also substitute the 'contains' with 'starts-with' and 'ends-with' correspondingly.
I am getting WebDriverException while trying to select the 2nd checkbox in the list. I am able to select the 1st check box but on the 2nd time my code throwing exception. Please find the method that i am using and exception message below.
Note: Any suggestion will be helpful for me.
URL: https://www.snapdeal.com/products/computers-external-hard-drives?sort=plrty&q=Capacity_s%3A1%20TB%7C
public void capacitySelection(String capacity){
WebDriverWait wd = new WebDriverWait(driver, 180);
List<WebElement> cList = wd.until(ExpectedConditions.presenceOfAllElementsLocatedBy(By.xpath("//div[#data-name='Capacity_s']/div")));
int i=1;
for(WebElement we:cList){
WebElement select= wd.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//div[#data-name='Capacity_s']/div["+ i++ +"]/label")));
if(select.getText().contains(capacity)){
select.click();
break;
}
}
}
Exception Message:
Exception in thread "main" org.openqa.selenium.WebDriverException: unknown error: Element is not clickable at point (106, 655). Other element would receive the click: <label for="Capacity_s-3TB">...</label>
(Session info: chrome=54.0.2840.99)
(Driver info: chromedriver=2.24.417431 (9aea000394714d2fbb20850021f6204f2256b9cf),platform=Windows NT 6.2.9200 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 86 milliseconds
Build info: version: 'unknown', revision: '1969d75', time: '2016-10-18 09:43:45 -0700'
System info: host: 'Bishnu', ip: '192.168.0.107', os.name: 'Windows 8', os.arch: 'amd64', os.version: '6.2', java.version: '1.8.0_111'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{applicationCacheEnabled=false, rotatable=false, mobileEmulationEnabled=false, networkConnectionEnabled=false, chrome={chromedriverVersion=2.24.417431 (9aea000394714d2fbb20850021f6204f2256b9cf), userDataDir=C:\Users\Bishnu\AppData\Local\Temp\scoped_dir11044_5076}, takesHeapSnapshot=true, pageLoadStrategy=normal, databaseEnabled=false, handlesAlerts=true, hasTouchScreen=false, version=54.0.2840.99, platform=WIN8, browserConnectionEnabled=false, nativeEvents=true, acceptSslCerts=true, locationContextEnabled=true, webStorageEnabled=true, browserName=chrome, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true}]
Session ID: 505ec9fb429bc6b9806edb52d75856f0
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
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.RemoteWebElement.execute(RemoteWebElement.java:274)
at org.openqa.selenium.remote.RemoteWebElement.click(RemoteWebElement.java:84)
at in.prolearn.pages.HomePage.SecondCapacitySelection(HomePage.java:59)
at in.prolearn.testcases.VerifySnapDealSelection.main(VerifySnapDealSelection.java:22)
Thanks.
Can you use JavaScript instead
WebElement product = new WebDriverWait(aDriverInstance, 5L).
until(ExpectedConditions.visibilityOfElementLocatedBy(By.id("anID")));
JavascriptExecutor jsExec = (JavascriptExecutor) aDriverInstance;
jsExec.executeScript("arguments[0].scrollIntoView()", product);
Actions actions = new Actions(driver);
actions.moveToElement(select).click().perform();
Try to click the element with Actions class. This will help you.
Use .isSelected() method before performing click on that element.
I am trying to identify a link in the CQ5 webpage and click on it.
Below is the html code:
<a href="/siteadmin" title="Websites">
<div class="icon siteadmin">
<div class="title">Websites</div>
<div class="description">Create and manage multiple websites.
</div>
</div>
</a>
The below are method i tried to find the information and click on it.
driver.findElement(By.linkText("Websites")).click();
driver.findElement(By.xpath("//a[#href='/siteadmin']")).click();
Getting following exception:
Exception in thread "main" org.openqa.selenium.WebDriverException: unknown error: Element is not clickable at point (528, 174). Other element would receive the click: <div class="resourcebox">...</div>
(Session info: chrome=52.0.2743.116)
(Driver info: chromedriver=2.22.397933 (1cab651507b88dec79b2b2a22d1943c01833cc1b),platform=Windows NT 6.1.7601 SP1 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 39 milliseconds
Build info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:32:46'
System info: host: 'pilapwin7020', ip: '10.116.252.187', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_101'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{applicationCacheEnabled=false, rotatable=false, mobileEmulationEnabled=false, chrome={chromedriverVersion=2.22.397933 (1cab651507b88dec79b2b2a22d1943c01833cc1b), userDataDir=C:\Users\User\AppData\Local\Temp\scoped_dir44444_30971}, takesHeapSnapshot=true, databaseEnabled=false, handlesAlerts=true, hasTouchScreen=false, version=52.0.2743.116, platform=XP, browserConnectionEnabled=false, nativeEvents=true, acceptSslCerts=true, locationContextEnabled=true, webStorageEnabled=true, browserName=chrome, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true}]
Session ID: 5116ba44126c39293ac466aed3d6608a
You should try using JavascriptExecutor to perform click in this case as :-
((JavascriptExecutor)driver).executeScript("arguments[0].click()", driver.findElement(By.cssSelector("a[href = '/siteadmin'][title = 'Websites']")));
You need to check if the attr contains the string, because it returns the fullpath even if in the HTML shows only /siteadmin.
XPath Solution:
//a[contains(#href, '/siteadmin') and #title='Websites']
Css Selector Solution:
a[href*='/siteadmin'][title='Websites']
I am getting following error while running selenium testcases.
Using the versions firefox 45 and selenium-server-standalone 2.52.
org.openqa.selenium.WebDriverException: Element is not clickable at
point (62, 13.333328247070312). Other element would receive the click:
(WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 21 milliseconds Build info: version:
'2.52.0', revision: '4c2593c', time: '2016-02-11 19:06:42' System
info: host:
'mesos-wl-servicetest-8f2fe7b6-d8bd-429f-abfc-cf5d29242b38', ip:
'172.31.6.249', os.name: 'Linux', os.arch: 'amd64', os.version:
'4.4.2-1.el7.elrepo.x86_64', java.version: '1.8.0_51' Driver info:
org.openqa.selenium.firefox.FirefoxDriver Capabilities
[{applicationCacheEnabled=true, rotatable=false,
pageLoadStrategy=fast, handlesAlerts=true, databaseEnabled=true,
version=45.1.0, platform=LINUX, nativeEvents=false,
acceptSslCerts=false, webStorageEnabled=true,
locationContextEnabled=true, browserName=firefox,
takesScreenshot=true, javascriptEnabled=true,
pageLoadingStrategy=fast, cssSelectorsEnabled=true}] Session ID:
d6ae5f7f-be19-4b79-b248-dfb034d6ce1c 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:422)
at
org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206)
at
org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158)
at
org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:678)
at
org.openqa.selenium.remote.RemoteExecuteMethod.execute(RemoteExecuteMethod.java:35)
at org.openqa.selenium.remote.RemoteMouse.click(RemoteMouse.java:59)
at
org.openqa.selenium.interactions.ClickAction.perform(ClickAction.java:37)
at
org.openqa.selenium.interactions.CompositeAction.perform(CompositeAction.java:50)
at org.openqa.selenium.interactions.Actions.perform(Actions.java:373)
You should try using JavascriptExecutor
WebElement el = driver.findElement....;
JavascriptExecutor executor = (JavascriptExecutor)driver
executor.executeScript("arguments[0].click()", el);
Hope it will help you to perform click...:)
JavascriptExecutor click is an good option to avoid element is not clickable at point (xx,yy). Other element would receive the click.
ANother alternate that you can use is explicit wait for presence of that element
Possible solutions can be ..
1)Try to maximize the browser when you are working with resolutions greater than 1024x768.
driver.manage().window().maximize();
2) Using Actions Class
WebElement element = driver.findElement(By("element"));
Actions action = new Actions(driver);
action.moveToElement(element).click().perform();
3) using JavaScriptExecutor
WebElement el = driver.findElement(By("element"));
JavascriptExecutor executor = (JavascriptExecutor)driver
executor.executeScript("arguments[0].click()", el);
I am trying to find element "core_text savable core_valid_regex" but everytime I am getting some or the other error.
<form id="core_order_holder" onsubmit="return false;">
<table class="order_holder">
<tbody class="core_loader_holder">
<tr>
<td class="core_item_label">Personal number:</td>
<td class="core_item_content">
<span class="savable-wrapper">
<input class="**core_text savable core_valid_regex**" type="text" name="loginid" size="13" style="outline: medium none;">
<span class="savable">
</span>
</td>
</tr>
Till now I have tried the following approaches:
WebElement PersonalNumber = (new WebDriverWait(driver, 30)) .until(ExpectedConditions.presenceOfElementLocated(By.className("order_holder"))).findElement(By.className("core_loader_holder")).findElement(By.className("core_item_content")).findElement(By.className("savable-wrapper")).findElement(By.className("core_text savable"));
WebElement E1 = PersonalNumber.findElement(By.className("core_loader_holder")).findElement(By.className("core_item_content"));
WebElement E2 = E1.findElement(By.className("core_item_content"));
WebElement E3 = E2.findElement(By.className("savable-wrapper"));
WebElement E4 = E3.findElement(By.className("core_text savable"));
WebElement PersonalNumber = driver.findElement(By.className("core_text savable"));
WebElement PersonalNumber = (new WebDriverWait(driver, 30))
.until(ExpectedConditions.presenceOfElementLocated(By.className("core_text savable")));
WebElement E1 = (new WebDriverWait(driver, 30)).until(ExpectedConditions.presenceOfAllElementsLocatedBy(PersonalNumber.findElement(By.className("core_loader_holder"))));
WebElement PersonalNumber = driver.findElement(By.className("order_holder") ).findElement(By.className("core_loader_holder")).findElement(By.className("core_item_content")).findElement(By.className("savable-wrapper")).findElement(By.name("loginid"));
Please find below the error:
Exception in thread "main" org.openqa.selenium.NoSuchElementException: Unable to locate element: {"method":"class name","selector":"core_item_content"}
Command duration or timeout: 82 milliseconds
For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html
Build info: version: '2.45.0', revision: '32a636c', time: '2015-03-05 22:01:35'
System info: host: 'PC239657', ip: '172.31.204.104', os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.7.0'
*** Element info: {Using=class name, value=core_item_content}
Session ID: 1a8604de-4ec7-4a77-ba8b-b1590ae49ce6
Driver info: org.openqa.selenium.firefox.FirefoxDriver
Capabilities [{platform=WINDOWS, acceptSslCerts=true, javascriptEnabled=true, browserName=firefox, rotatable=false, locationContextEnabled=true, version=34.0.5, cssSelectorsEnabled=true, databaseEnabled=true, handlesAlerts=true, nativeEvents=true, webStorageEnabled=true, applicationCacheEnabled=true, takesScreenshot=true}]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:204)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:156)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:599)
at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:268)
at org.openqa.selenium.remote.RemoteWebElement.findElement(RemoteWebElement.java:171)
at org.openqa.selenium.remote.RemoteWebElement.findElementByClassName(RemoteWebElement.java:228)
at org.openqa.selenium.By$ByClassName.findElement(By.java:387)
at org.openqa.selenium.remote.RemoteWebElement.findElement(RemoteWebElement.java:167)
at Submit_Order.TrustlySubmitOrder(Submit_Order.java:237)
at Submit_Order.main(Submit_Order.java:260)
Caused by: org.openqa.selenium.NoSuchElementException: Unable to locate element: {"method":"class name","selector":"core_item_content"}
For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html
Build info: version: '2.45.0', revision: '32a636c', time: '2015-03-05 22:01:35'
System info: host: 'PC239657', ip: '172.31.204.104', os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.7.0'
Driver info: driver.version: unknown
at <anonymous class>.FirefoxDriver.prototype.findElementInternal_(file:///C:/Users/291578/AppData/Local/Temp/anonymous5858848057389913831webdriver-profile/extensions/fxdriver#googlecode.com/components/driver-component.js:10271)
at <anonymous class>.FirefoxDriver.prototype.findChildElement(file:///C:/Users/291578/AppData/Local/Temp/anonymous5858848057389913831webdriver-profile/extensions/fxdriver#googlecode.com/components/driver-component.js:10283)
at <anonymous class>.DelayedCommand.prototype.executeInternal_/h(file:///C:/Users/291578/AppData/Local/Temp/anonymous5858848057389913831webdriver-profile/extensions/fxdriver#googlecode.com/components/command-processor.js:12274)
at <anonymous class>.DelayedCommand.prototype.executeInternal_(file:///C:/Users/291578/AppData/Local/Temp/anonymous5858848057389913831webdriver-profile/extensions/fxdriver#googlecode.com/components/command-processor.js:12279)
at <anonymous class>.DelayedCommand.prototype.execute/<(file:///C:/Users/291578/AppData/Local/Temp/anonymous5858848057389913831webdriver-profile/extensions/fxdriver#googlecode.com/components/command-processor.js:12221)
How to find the element?
Is it always the only input element in the form? Does it always have the same name attribute?
In that case, you can simply try:
WebElement input = driver.findElement(By.Name("loginid"));
Or:
WebElement input = driver.findElement(By.CssSelector("#core_order_holder input"));