Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
» how to connect DB in selenium webriver
Fri Oct 06, 2017 4:09 pm by anbarasi

» How find any text in browser screen and click on it?
Thu Oct 05, 2017 2:02 pm by sandeepkommineni

» Selenium Webdriver
Tue Oct 03, 2017 1:35 pm by PiyushBiswas

» GRID setup tutorial.
Wed Sep 27, 2017 4:29 pm by johnyapp

» Drag & Drop Between Windows Using Selenium Driver
Wed Sep 27, 2017 2:10 pm by 26rondel

» Check if window is closed / verify input
Sat Sep 23, 2017 10:21 pm by brainstir

» How to work on pages with AJAX in selenium?
Mon Sep 18, 2017 6:08 pm by azharuddin

» pause test until user press a key like F2
Wed Aug 09, 2017 11:10 pm by djnforce

» Selecting the input for auto populating element
Sat Jul 29, 2017 7:53 pm by kdabbara

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Unable to select Box using selenium2.0

View previous topic View next topic Go down

Unable to select Box using selenium2.0

Post by kesireddysudha@gmail.com on Tue Jan 28, 2014 9:57 am

Hi,

I am newbie to selenium.
I was trying to select a value from the select box in telugumatrimony.com
i am using firefox 12.0 and eclipse ...

telugumatrimony.com In this site, for religion select box, when i try to select " Hindu" by using this sentence 

wd.findElement(By.xpath(".//*[@id='RELIGION']")).sendKeys("Hindu");

it is selecting a different option .

Also, i selected RELIGION and Mother Tongue using these statements (these two work fine using these statements)

WebDriver  wd=new FirefoxDriver();
wd.get("http:telugumatrimony.com");

wd.findElement(By.xpath(".//*[@id='REGISTERED_BY']")).sendKeys("Myself");

Select dropdow=new Select(wd.findElement(By.xpath(".//*[@id='REGISTERED_BY']")));
dropdow.selectByVisibleText("Son");

Select dropdown = new Select(wd.findElement(By.xpath(".//*[@id='RELIGION']")));
dropdown.selectByIndex(1);

Select dropdown1=new Select(wd.findElement(By.xpath(".//*[@id='MOTHERTONGUE']")));
dropdown1.selectByIndex(49);

After this , the caste comes ......
 Select dropdown2=new Select(wd.findElement(By.xpath("//*[@id='TEMP_CASTE_NORMAL']")));
dropdown2.selectByIndex(1);



This is giving some error ..........

Exception in thread "main" org.openqa.selenium.support.ui.UnexpectedTagNameException: Element should have been "select" but was "input"
Build info: version: '2.39.0', revision: 'ff23eac', time: '2013-12-16 16:12:12'
System info: host: 'admin-HP', ip: '192.168.1.146', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.6.0_21'
Driver info: driver.version: unknown
at org.openqa.selenium.support.ui.Select.(Select.java:46)
at Pack1.matri.main(matri.java:28)


What is the wrong i did ???? (OR) what is the xpath to be written to select CASTE ??????

Thanks,
Sudha

kesireddysudha@gmail.com

Posts : 1
Join date : 2014-01-28

Back to top Go down

Re: Unable to select Box using selenium2.0

Post by nabhanya.varma on Tue Dec 16, 2014 12:27 am

You need to check the tags that are used. 

You can visit the below site for more information on Select Working with Select
http://seleniumeasy.com/tags/select

nabhanya.varma
Active particpant
Active particpant

Posts : 13
Join date : 2014-03-02

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