Module 14 | Selenium Forum
M
Posted on 29/08/2016
I tried with different options to retrieve values from combo (including "Actions driver"). But size of combo is printed as "0". Even in debug mode, xpath is not displaying any value. It is totally a different scenario and unable to proceed further. can you please help me??

1) Not able to use "Select class" since this combo is built differently
2) Tried with another option: breaking xpath into 2 strings and passing dynamic value using "while loop"
3) Used "Actions class" also

M
Replied on 30/08/2016

there is no select in departure city.

you have to use something like this

[code:1fypl3ze]driver.findElement(
By.xpath("//*[@id='widget_row']/div[1]/div/div[3]/div/div[4]/div[1]/div[1]/div/span[2]/input"))
.sendKeys("Chandigarh");
;Thread.sleep(2000);
driver.findElement(
By.xpath("//*[@id='widget_row']/div[1]/div/div[3]/div/div[4]/div[1]/div[1]/div/span[2]/input"))
.sendKeys(Keys.RETURN);

[/code:1fypl3ze]


M
Replied on 30/08/2016

Can you please help me in identifying size of combo & its values using
driver.findElement(
By.xpath("//*[@id='widget_row']/div[1]/div/div[3]/div/div[4]/div[1]/div[1]/div/span[2]/input"))
.sendKeys(Keys.RETURN);


M
Replied on 30/08/2016

[quote:35ymi2eq]Can you please help me in identifying size of combo & its values using [/quote:35ymi2eq]
i didn't get you.


M
Replied on 31/08/2016

In this scenario, how to identify size of combo and print all values in combo?


M
Replied on 31/08/2016

what combo?


M
Replied on 31/08/2016

How to print size and values in dropdown--"From" & list box - "Destination"


M
Replied on 31/08/2016

cannot be done in listbox.

and in from you will have click the dropdown first and then getText.