Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
» Regarding Alert Interface
Fri Feb 24, 2017 2:00 pm by karthikeyakumar

» Geting issues in identifying the elsements in webdriver
Fri Feb 17, 2017 4:41 pm by janbaskt

» WebDriver - why not to use a singlton for it?
Fri Feb 17, 2017 4:40 pm by janbaskt

» WebDriver session when using testng annotation to invoke driver instance
Fri Feb 17, 2017 4:39 pm by janbaskt

» Selenium fails to launch Chrome
Fri Feb 17, 2017 4:39 pm by janbaskt

» why do i get this error
Fri Feb 17, 2017 4:38 pm by janbaskt

» Selenium Tutorial
Thu Feb 16, 2017 5:21 pm by Rahul

» When to use Selenium IDE, RC and WebDriver
Mon Feb 13, 2017 2:35 pm by azharuddin

» How to integrate selenium with ZAPI-Zephyr
Sat Feb 11, 2017 2:25 am by gseera002c

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

comparing a string with the strings present in the drop down list

View previous topic View next topic Go down

comparing a string with the strings present in the drop down list

Post by bharathip on Fri Nov 11, 2011 12:38 pm

Hi all

I want to throw an exception if ,a string given in excel sheet is not present in the drop down list of an application.
how to check whether a string is present in the drop down list or not.

Can anyone help me...!!

bharathip

Posts : 8
Join date : 2011-11-08

Back to top Go down

Re: comparing a string with the strings present in the drop down list

Post by freesky on Fri Nov 11, 2011 3:48 pm

assertText or verifyText

freesky
Amateur
Amateur

Posts : 72
Join date : 2011-04-13

Back to top Go down

Re: comparing a string with the strings present in the drop down list

Post by faramka on Mon Nov 14, 2011 3:05 pm

You can use one of the getSelect... methods.
For example:
getSelectOptions(selectLocator) - gets all option labels in the specified select drop-down.
And then verify if the text is presented in returned array.

faramka
Professional
Professional

Posts : 143
Join date : 2011-09-15
Location : Poland

Back to top Go down

Re: comparing a string with the strings present in the drop down list

Post by dine on Fri Mar 30, 2012 5:05 am

Hi faramka,
I don't know how to use getSelectOptions nether how to verify if the text is present in a array. Could you give an example? Embarassed Thanks very much!!

dine

Posts : 1
Join date : 2012-03-30

Back to top Go down

Re: comparing a string with the strings present in the drop down list

Post by deshjoshi on Sun Apr 01, 2012 1:16 pm

Hi,

You can try following command to verify the text present in dropdown:

assertTrue(selenium.isElementPresent("css=select#unitNameSelection:contains('"+lstrVehName+"')"));

In the above command 'lstrVehName' Im passing it as a string variable.

Where,
unitNameSelection: Is ID of your dropdown box.
lstrVehName: Is text is to verify in the dropdown.

deshjoshi

Posts : 4
Join date : 2012-04-01

Back to top Go down

Re: comparing a string with the strings present in the drop down list

Post by Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

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