Share
Go down
gaveyom
Amateur
Amateur
Posts : 38
Join date : 2011-07-13

how to select dropdown value

on Mon Nov 28, 2011 12:22 pm
Hi All,

how to select a value in drop down

below are the id and value of drop down
@id=drpyear
@value=2002-03

please let me know the correct syntax
faramka
Professional
Professional
Posts : 143
Join date : 2011-09-15
Location : Poland

Re: how to select dropdown value

on Mon Nov 28, 2011 3:40 pm
Code:
selenium.select('drpyear', 'value=2002-03');

I recommend reading the documentation Smile
gaveyom
Amateur
Amateur
Posts : 38
Join date : 2011-07-13

Re: how to select dropdown value

on Tue Nov 29, 2011 12:40 am
Hi faramka,

thank you for your reply, its working

when i try to get all the links under div tag

driver.findElements(By.xpath("//div[@id='divID']//a"));

it is working for one application same script im using for another application but it not working show below error, another application is also same as working application

the working application is prepared in .net and not working application is prepared in share point

************************************************************

Nov 29, 2011 4:37:07 AM org.apache.http.impl.client.DefaultRequestDirector execute
INFO: I/O exception (org.apache.http.NoHttpResponseException) caught when processing request: The target server failed to respond
Nov 29, 2011 4:37:07 AM org.apache.http.impl.client.DefaultRequestDirector execute
INFO: Retrying request
Exception in thread "main" org.openqa.selenium.WebDriverException: org.apache.http.conn.HttpHostConnectException: Connection to http://127.0.0.1:7055 refused
Build info: version: '2.0.0', revision: '12817', time: '2011-07-07 19:13:58'
System info: os.name: 'Windows NT (unknown)', os.arch: 'x86', os.version: '6.1', java.version: '1.5.0_05'
Driver info: driver.version: RemoteWebDriver
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:399)
at org.openqa.selenium.remote.RemoteWebDriver.findElements(RemoteWebDriver.java:201)
at org.openqa.selenium.remote.RemoteWebDriver.findElementsByXPath(RemoteWebDriver.java:267)
at org.openqa.selenium.By$ByXPath.findElements(By.java:318)
at org.openqa.selenium.remote.RemoteWebDriver.findElements(RemoteWebDriver.java:178)
at Sample_Path.(Sample_Path.java:62)
at Sample_Path.main(Sample_Path.java:40)
Caused by: org.apache.http.conn.HttpHostConnectException: Connection to http://127.0.0.1:7055 refused
at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:159)
at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:149)
at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:108)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:508)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:641)
at org.openqa.selenium.remote.HttpCommandExecutor.fallBackExecute(HttpCommandExecutor.java:272)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:252)
at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.execute(NewProfileExtensionConnection.java:123)
at org.openqa.selenium.firefox.FirefoxDriver$LazyCommandExecutor.execute(FirefoxDriver.java:257)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:382)
... 6 more
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at org.openqa.selenium.remote.ReusingSocketSocketFactory.connectSocket(ReusingSocketSocketFactory.java:122)
at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:133)
... 15 more

************************************************************

please let me know y this error is getting
Sponsored content

Re: how to select dropdown value

Back to top
Permissions in this forum:
You cannot reply to topics in this forum