Selecting the value from dropdown menu

1,025 views
Skip to first unread message

Vinay

unread,
Apr 15, 2014, 8:32:43 AM4/15/14
to webd...@googlegroups.com
I need to select the value "3" from drop down menu, which gets displayed after clicking the "blue arrow" as attached in screenshot.Please help its urgent.
Drop Down.docx

Krishnan Mahadevan

unread,
Apr 15, 2014, 8:38:00 AM4/15/14
to webdriver
What have you done so far in terms of figuring out this on your own ?

What does your code look like ?

Where are you stuck ?

It would be good if you could please help add this information as well.

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribbings @ http://rationaleemotions.wordpress.com/


On Tue, Apr 15, 2014 at 6:02 PM, Vinay <vkan...@gmail.com> wrote:
I need to select the value "3" from drop down menu, which gets displayed after clicking the "blue arrow" as attached in screenshot.Please help its urgent.

--
You received this message because you are subscribed to the Google Groups "webdriver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to webdriver+...@googlegroups.com.
To post to this group, send email to webd...@googlegroups.com.
Visit this group at http://groups.google.com/group/webdriver.
For more options, visit https://groups.google.com/d/optout.

Vinay

unread,
Apr 16, 2014, 5:38:19 AM4/16/14
to webd...@googlegroups.com
Hi Krishnan,
 I want to select item from dropdown.I used

new Select(driver.findElement(By.id("elementid"))).selectByValue("3");

It is not working

I have attached screenshot of dropdown.Dropdown has got 25 items and I need to select the third option from dropdown.But I am unable to do that.

Required info for dropdown

div id="boundlist-1111-listEl" class="x-boundlist-list-ct x-unselectable" style="overflow: auto; height: auto;" role="presentation">
<ul class="x-list-plain">
<li class="x-boundlist-item" unselectable="on" role="option">1</li>
<li class="x-boundlist-item" unselectable="on" role="option">2</li>
<li class="x-boundlist-item x-boundlist-item-over" unselectable="on" role="option">3</li>
<li class="x-boundlist-item" unselectable="on" role="option">4</li>
</ul>
</div>
</div>
</body>
</html>
</document>

Please reply







Screenshot dropdown.docx

Jenn Petersen

unread,
Apr 16, 2014, 9:41:32 AM4/16/14
to webd...@googlegroups.com
Hi Vinay,

I do not see from the code you posted if the select tag was used for this drop down. Right now it is an unordered list masquerading in the form of a drop down. 

From my understanding and experience, I don't believe you can use Select unless it was implemented as a tag in the drop down. I will be most happy to have someone in this group with more experience correct my impression.

See: 

My suggestion is to use Action Chains to put the focus on the drop down. From there, it is going to depend on the behavior of the drop down. If you can type in the box,  you can use Send Keys to get the value you desire. Or you could also iterate through the options. Forgive me for not posting an example, I am using Python instead of Javascript and I am still learning myself. I can't give you more advice as I don't know how this specific drop down behaves.

Jim Evans

unread,
Apr 16, 2014, 1:42:01 PM4/16/14
to webd...@googlegroups.com
You won't be able to use the Select class with this dropdown list. The Select class is intended to only be used with <select> elements. This is not a <select> element; it's a <div> with a <ul> inside it.


On Wednesday, April 16, 2014 5:38:19 AM UTC-4, Vinay wrote:

Yagnesh Shah

unread,
Apr 17, 2014, 8:05:30 AM4/17/14
to webd...@googlegroups.com
Your HTML dom doesn't have select attribute so you can't use selectByValue and other select methods. But, here is a work around for other types of HTML dom containing drop-down menu like: span, ul/li, bootstarp dropdown:


@FindBy(xpath = ".//*[@id='boundlist-1111-listEl']")
public static WebElement list; //pageobject for drop-down button to expand the drop-down menu

@FindBy(xpath = ".//*[@id='boundlist-1111-listEl']/ul")
public static WebElement boundlist; //since your DOM doesn't have "select" attribute so write customized xPath until you reach the parent of "li" attribute

//expand the dropdown menu first since sometimes HTML DOM structure is updated dynamically when drop-down menu is expanded.
list.click();
//wait for sometime here to make sure all values are loaded on listing the drop-down menu

//now collect all the options under drop-down menu into a list
List<WebElement> options = boundlist.findElements(By.className("x-boundlist-item"));
for (WebElement ops : options) 
{
            if (ops.getText().equals("3"))    //compare ops.getText() with the value you wish to select from drop-down. if found then clicks on that value..
            {
                ops.click(); 
                break;
            }
            else
            {
            System.out.println("option "3" is a mismatch with values available in drop-down");
            }
}

Done...you should be able to click on any value you wish to select from drop-down
--
Yagnesh Shah

Kandurke Vinayak

unread,
Apr 19, 2014, 12:40:01 AM4/19/14
to webd...@googlegroups.com
Hi Jim,
 Thanks for your reply.Plz can u tell me the solution for selecting the item from dropdown menu.Plz help it's urgent.


--
You received this message because you are subscribed to a topic in the Google Groups "webdriver" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/webdriver/HtHYGCD6jPM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to webdriver+...@googlegroups.com.

Krishnan Mahadevan

unread,
Apr 19, 2014, 12:45:30 AM4/19/14
to webd...@googlegroups.com
Use WebDriver.findElement() to find the "li" item and then invoke the click() method on it. 

~ Krishnan

iSent. iPhone. iReget.iTypos!
You received this message because you are subscribed to the Google Groups "webdriver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to webdriver+...@googlegroups.com.

Kandurke Vinayak

unread,
Apr 19, 2014, 12:56:46 AM4/19/14
to webd...@googlegroups.com
Hi Krishnan,
 Thanks for your reply.I used
driver.findElement(By.id("idofdropdown")).click();
By this way, only cursor is seen in blank textbox.But not selection of item from dropdown menu.
To view dopdown menu we have to click right extreme arrow mark besides that textbox and then we can view the dropdown menu and select the item from it.We have to click the arrow mark compulsory to view drop down menu.Is there any other way to select the item from dropdown menu without clicking the arrow mark.Plz reply.

darrell

unread,
Apr 19, 2014, 8:01:38 AM4/19/14
to webd...@googlegroups.com
How would you test this manually? If the actions to test it manually are:

- click the arrow mark to make the menu appear
- click the item on the menu

Then you need to simulate this with WebDriver.:

- use findElement to find the arrow mark
- click the arrow mark element
- use findElement to find the menu item (LI)
- click the menu item

On the other hand, if the actions to test it manually are:

- hover mouse over the arrow mark
- wait for the menu to appear
- click the menu item

then you need to automate that.

Kandurke Vinayak

unread,
Apr 19, 2014, 8:20:55 AM4/19/14
to webd...@googlegroups.com
Hi Darell,
locators for arrow mark are changing dynamically.So how we should click it?

darrell

unread,
Apr 20, 2014, 7:50:37 AM4/20/14
to webd...@googlegroups.com
How would you identify the arrow mark manuallly? Simulate the same thing with a locator. If the arrow mark has a known GIF as an image then use the GIF src to find the arrow mark.

Kandurke Vinayak

unread,
Apr 21, 2014, 12:31:22 AM4/21/14
to webd...@googlegroups.com
Hi darell,
  id for arrow mark is changing dynamically.Required information for arrowmark is
<td id="ext-gen1667" class=" x-trigger-cell x-unselectable" valign="top" style="width:17px;" role="presentation">
<div id="ext-gen1666" class="x-trigger-index-0 x-form-trigger x-form-arrow-trigger x-form-trigger-first" role="presentation"></div>
</td>
</tr>
</tbody>
</table>
</td>
So how to select the arrow mark.We have to click the arrow mark to view the dropdown menu and select the item from it.Please reply.

vadapalli kalyan

unread,
Apr 21, 2014, 6:30:00 AM4/21/14
to webd...@googlegroups.com
webelement we=driver.findelement(by.id("elementid"));
select sel=new select(we);
sel.selectByValue(3);

Jim Evans

unread,
Apr 21, 2014, 7:19:43 AM4/21/14
to webd...@googlegroups.com
If the ID is dynamically generated (thanks, ExtJS), you'll need to find some other mechanism to locate the element. Perhaps using a CSS selector would work? Something like By.cssSelector("div.x-form-arrow-trigger").

Kandurke Vinayak

unread,
Apr 21, 2014, 9:13:11 AM4/21/14
to webd...@googlegroups.com
Hi Jim,
 Thanks for your reply.I am having 2 dropdowns on the same page.
Information of first  arrow mark on dropdown is
<td id="ext-gen5344" class=" x-trigger-cell x-unselectable" valign="top" style="width:17px;" role="presentation">
<div id="ext-gen5344" class="x-trigger-index-0 x-form-trigger x-form-arrow-trigger x-form-trigger-first" role="presentation"></div>
</td>
</tr>
</tbody>
</table>
</td>
Information of  second arrowmark on second dropdown is:
<td id="ext-gen5246" class=" x-trigger-cell x-unselectable" valign="top" style="width:17px;" role="presentation">
<div id="ext-gen5245" class="x-trigger-index-0 x-form-trigger x-form-arrow-trigger x-form-trigger-first" role="presentation"></div>
</td>
</tr>
</tbody>
</table>
</td>
To view the drop down I need to click  arrow mark and then select the option from it. I want to select "Document" from first drop down and "Package" from Second dropdown.Please Reply.

darrell

unread,
Apr 21, 2014, 10:30:16 AM4/21/14
to webd...@googlegroups.com
I think I might not have been clear. When I asked how you would identify the arrow mark manually I meant, "how would you identify the arrow mark if you were manually testing the application?" I would hope you are not inspecting the DOM when manually testing the application. You look at the screen. You see the arrow mark. Are there multiple arrow marks on the page? What makes the one you pick different from the rest? Or if there is only one arrow mark on the page, you know you want THE arrow mark. 

From your code example, an arrow mark contains the class "x-form-arrow-trigger". So that will be part of your selector. Maybe "div.x-form-arrow-trigger" is a good start. If there are more than one arrow mark then you need to refine this to make it unique. What makes this arrow mark different from others?

Kandurke Vinayak

unread,
Apr 21, 2014, 10:42:29 AM4/21/14
to webd...@googlegroups.com
Hi darell,
   As there are two dropdowns with their respective arrow marks on it.Information regarding two arrow marks is same except its id which is dynamically changing.Other difference I can say is in contents of drop down menu which is displayed after clicking the arrow mark.So how to select the respective arrow mark and select the required option from drop down menu displayed after clicking the arrow mark.Please reply.

Kandurke Vinayak

unread,
Apr 23, 2014, 1:29:09 AM4/23/14
to webd...@googlegroups.com
Hi All,
I need to click the arrowmark to view the dropdown menu.My application is EXTjs based, so ids are generated dynamically
Required info for clicking the arrowmark

<td id="ext-gen1667" class=" x-trigger-cell x-unselectable" valign="top" style="width:17px;" role="presentation">
<div id="ext-gen1666" class="x-trigger-index-0 x-form-trigger x-form-arrow-trigger x-form-trigger-first" role="presentation"></div>
</td>
</tr>
</tbody>
</table>
</td>
Required info for selection of element from  drop down
<div id="boundlist-1364" class="x-boundlist x-boundlist-floating x-layer x-boundlist-default x-border-box" tabindex="-1" style="right: auto; left: 532px; top: 318px; width: 200px; z-index: 39001; height: 274px;">
<div id="boundlist-1364-listEl" class="x-boundlist-list-ct x-unselectable" style="overflow: auto; height: 273px;" role="presentation">
<ul class="x-list-plain">
<li class="x-boundlist-item" unselectable="on" role="option">First</li>
<li class="x-boundlist-item" unselectable="on" role="option">Second</li>
<li class="x-boundlist-item" unselectable="on" role="option">Packages</li>
<li class="x-boundlist-item" unselectable="on" role="option">Third</li>
</ul>
</div>
</div>
So how to click the arrow mark and selet the option from drop down menu.I have two such dropdowns on same page.Please Reply.


--
You received this message because you are subscribed to a topic in the Google Groups "webdriver" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/webdriver/HtHYGCD6jPM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to webdriver+...@googlegroups.com.

Chris Merrill

unread,
Apr 25, 2014, 10:53:33 AM4/25/14
to webd...@googlegroups.com
On 4/21/2014 10:42 AM, Kandurke Vinayak wrote:
> Hi darell,
> As there are two dropdowns with their respective arrow marks on it.Information regarding two
> arrow marks is same except its id which is dynamically changing.Other difference I can say is in
> contents of drop down menu which is displayed after clicking the arrow mark.So how to select the
> respective arrow mark and select the required option from drop down menu displayed after clicking
> the arrow mark.Please reply.

If you call driver.findElement() it will always return the first one, but it is possible
to write an XPath that matches more than one element. So if instead you call
driver.findElements(), you will get a list and you can select the 2nd (or 3rd or 4th)
element from the list as appropriate. The code would look something like:
driver.findElements(By.class("x-form-arrow-trigger")).get(2);

I _think_, you can also use an element higher in the hierarchy that is easier to locate and
then search the DOM starting from that point. I can't recall the last time I did this, but
if I'm remembering correctly, the code would be something like:

Element higher_element = driver.findElement(By.id("higher_element_id"));
Element the_one_i_want = higher_element.findElement(By.class("x-form-arrow-trigger"));

Chris


>
> On Mon, Apr 21, 2014 at 8:00 PM, darrell <darrell....@gmail.com
> <mailto:darrell....@gmail.com>> wrote:
>
> I think I might not have been clear. When I asked how you would identify the arrow mark manually
> I meant, "how would you identify the arrow mark if you were manually testing the application?" I
> would hope you are not inspecting the DOM when manually testing the application. You look at the
> screen. You see the arrow mark. Are there multiple arrow marks on the page? What makes the one
> you pick different from the rest? Or if there is only one arrow mark on the page, you know you
> want THE arrow mark.
>
> From your code example, an arrow mark contains the class "x-form-arrow-trigger". So that will be
> part of your selector. Maybe "div.x-form-arrow-trigger" is a good start. If there are more than
> one arrow mark then you need to refine this to make it unique. What makes this arrow mark
> different from others?
>
>
> On Monday, 21 April 2014 00:31:22 UTC-4, Vinay wrote:
>
> Hi darell,
> id for arrow mark is changing dynamically.Required information for arrowmark is
> <td id="ext-gen1667" class="x-trigger-cell
> x-unselectable" valign="top" s__tyle="width:17px;" role="prese__ntation">
> <div id="ext-gen1666" class="x__-trigger-index-0 x-form-trigger x-form-arrow-trigger
> x-form-trigger-first" role="pr__esentation"></div>
> driver.findElement(By.id("__idof____dropdown")).click();
>> *new*Select(/driver/.findElement(By./i________d/("elementid"))).__selectByValue______("3");
>>
>> It is not working
>>
>> I have attached screenshot of dropdown.Dropdown has got 25
>> items and I need to select the third option from dropdown.But
>> I am unable to do that.
>>
>> Required info for dropdown
>>
>> div id="boundlist-1111-listEl"________ class="x-boundlist-list-ct
>> x-unselectable" style="overflo________w: auto; height:
>> auto;" role="presentation">
>> <ul class="x-list-plain">
>> <li class="x-boundlist-item" u________nselectable="on" role="option"________>1</li>
>> <li class="x-boundlist-item" u________nselectable="on" role="option"________>2</li>
>> <li class="x-boundlist-item
>> x-boundlist-item-over" unselec________table="on" role="option">3</li________>
>> <li class="x-boundlist-item" u________nselectable="on" role="option"________>4</li>
>> </ul>
>> </div>
>> </div>
>> </body>
>> </html>
>> </document>
>>
>> Please reply
>>
>>
>>
>>
>>
>>
>>
>> --
>> You received this message because you are subscribed to a topic in
>> the Google Groups "webdriver" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/__to____pic/webdriver/HtHYGCD6jPM/__unsu____bscribe
>> <https://groups.google.com/d/topic/webdriver/HtHYGCD6jPM/unsubscribe>.
>> To unsubscribe from this group and all its topics, send an email
>> to webdriver+...@__googlegroups.com____.
>> To post to this group, send email to webd...@googlegroups.com.
>>
>> Visit this group at http://groups.google.com/__group____/webdriver
>> <http://groups.google.com/group/webdriver>.
>> For more options, visit https://groups.google.com/d/__op____tout
>> <https://groups.google.com/d/optout>.
>>
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "webdriver" group.
>> To unsubscribe from this group and stop receiving emails from it, send
>> an email to webdriver+...@__googlegroups.com____.
>>
>> To post to this group, send email to webd...@googlegroups.com.
>>
>> Visit this group at http://groups.google.com/__group____/webdriver
>> <http://groups.google.com/group/webdriver>.
>> For more options, visit https://groups.google.com/d/__op____tout
>> <https://groups.google.com/d/optout>.
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "webdriver" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/__to____pic/webdriver/HtHYGCD6jPM/__unsu____bscribe
> <https://groups.google.com/d/topic/webdriver/HtHYGCD6jPM/unsubscribe>.
> To unsubscribe from this group and all its topics, send an email to
> webdriver+...@__googlegroups.com____.
> To post to this group, send email to webd...@googlegroups.com.
>
> Visit this group at http://groups.google.com/__group____/webdriver
> <http://groups.google.com/group/webdriver>.
> For more options, visit https://groups.google.com/d/__op____tout
> <https://groups.google.com/d/optout>.
>
>
> --
> You received this message because you are subscribed to a topic in the Google
> Groups "webdriver" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/__to__pic/webdriver/HtHYGCD6jPM/__unsu__bscribe
> <https://groups.google.com/d/topic/webdriver/HtHYGCD6jPM/unsubscribe>.
> To unsubscribe from this group and all its topics, send an email to
> webdriver+...@__googlegroups.com__.
> To post to this group, send email to webd...@googlegroups.com.
> Visit this group at http://groups.google.com/__group__/webdriver
> <http://groups.google.com/group/webdriver>.
> For more options, visit https://groups.google.com/d/__op__tout
> <https://groups.google.com/d/optout>.
>
>
> --
> You received this message because you are subscribed to a topic in the Google Groups
> "webdriver" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/__topic/webdriver/HtHYGCD6jPM/__unsubscribe
> <https://groups.google.com/d/topic/webdriver/HtHYGCD6jPM/unsubscribe>.
> To unsubscribe from this group and all its topics, send an email to
> webdriver+...@__googlegroups.com.
> To post to this group, send email to webd...@googlegroups.com.
> Visit this group at http://groups.google.com/__group/webdriver
> <http://groups.google.com/group/webdriver>.
> For more options, visit https://groups.google.com/d/__optout
> <https://groups.google.com/d/optout>.
>
>
> --
> You received this message because you are subscribed to a topic in the Google Groups "webdriver"
> group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/webdriver/HtHYGCD6jPM/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> webdriver+...@googlegroups.com <mailto:webdriver+...@googlegroups.com>.
> To post to this group, send email to webd...@googlegroups.com <mailto:webd...@googlegroups.com>.
> Visit this group at http://groups.google.com/group/webdriver.
> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> You received this message because you are subscribed to the Google Groups "webdriver" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
> webdriver+...@googlegroups.com <mailto:webdriver+...@googlegroups.com>.
> To post to this group, send email to webd...@googlegroups.com <mailto:webd...@googlegroups.com>.
> Visit this group at http://groups.google.com/group/webdriver.
> For more options, visit https://groups.google.com/d/optout.


--
------------------------------------------------------------------------ -
Chris Merrill | Web Performance, Inc.
ch...@webperformance.com | http://webperformance.com
919-433-1762 | 919-845-7601

Web Performance: Website Load Testing Software & Services
------------------------------------------------------------------------ -

Kandurke Vinayak

unread,
Apr 25, 2014, 11:00:53 AM4/25/14
to webd...@googlegroups.com
Hi Chris,
 Thanks for reply.There 2 dropdowns on same page.For first dropdown
 driver.findElements(By.class("x-form-arrow-trigger")).
works,but what about second dropdown on same page.It has got same class as first drop down.Please reply.


To unsubscribe from this group and all its topics, send an email to webdriver+...@googlegroups.com.

To post to this group, send email to webd...@googlegroups.com.

Chris Merrill

unread,
Apr 25, 2014, 11:13:59 AM4/25/14
to webd...@googlegroups.com
On 4/25/2014 11:00 AM, Kandurke Vinayak wrote:
> Hi Chris,
> Thanks for reply.There 2 dropdowns on same page.For first dropdown
> driver.findElements(By.class("x-form-arrow-trigger")).
> works,but what about second dropdown on same page.It has got same class as first drop down.Please reply.

I feel like you did not read my entire reply, or perhaps did not read it thoroughly or
understand it, because I've already shown how to get the second one (well, actually the third).

You said "driver.findElements(By.class("x-form-arrow-trigger")) works". How do you
know? What did the return value contain?

Note that the findElements() method will NEVER throw an NoSuchElementException. If no
elements are found, it returns an empty list. So if that is how you are judging if it
works, you will need to look at the size of the list instead of catching an exception.


Also, you deleted the important part of my suggestion - the ".get(N)" part.

Instead of
driver.findElement(By.class("x-form-arrow-trigger"))
you would use
driver.findElements(By.class("x-form-arrow-trigger")).get(N)
where N is the zero-based index of the element that you want (e.g. if you want
the 2nd element, then N=1).

Hope that helps,
Chris


> On Fri, Apr 25, 2014 at 8:23 PM, Chris Merrill <ch...@webperformance.com
> <mailto:ch...@webperformance.com>> wrote:
>
> On 4/21/2014 10:42 AM, Kandurke Vinayak wrote:
> > Hi darell,
> > As there are two dropdowns with their respective arrow marks on it.Information regarding two
> > arrow marks is same except its id which is dynamically changing.Other difference I can say is in
> > contents of drop down menu which is displayed after clicking the arrow mark.So how to select the
> > respective arrow mark and select the required option from drop down menu displayed after clicking
> > the arrow mark.Please reply.
>
> If you call driver.findElement() it will always return the first one, but it is possible
> to write an XPath that matches more than one element. So if instead you call
> driver.findElements(), you will get a list and you can select the 2nd (or 3rd or 4th)
> element from the list as appropriate. The code would look something like:
> driver.findElements(By.class("x-form-arrow-trigger")).get(2);
>
> I _think_, you can also use an element higher in the hierarchy that is easier to locate and
> then search the DOM starting from that point. I can't recall the last time I did this, but
> if I'm remembering correctly, the code would be something like:
>
> Element higher_element = driver.findElement(By.id("higher_element_id"));
> Element the_one_i_want = higher_element.findElement(By.class("x-form-arrow-trigger"));
>
> Chris
>
>
> >
> > On Mon, Apr 21, 2014 at 8:00 PM, darrell <darrell....@gmail.com
> <mailto:darrell....@gmail.com>
> >> To post to this group, send email to webd...@googlegroups.com
> <mailto:webd...@googlegroups.com>.
> >>
> >> Visit this group at
> http://groups.google.com/__group____/webdriver
> >> <http://groups.google.com/group/webdriver>.
> >> For more options, visit https://groups.google.com/d/__op____tout
> >> <https://groups.google.com/d/optout>.
> >>
> >>
> >> --
> >> You received this message because you are subscribed to the Google
> >> Groups "webdriver" group.
> >> To unsubscribe from this group and stop receiving emails from it,
> send
> >> an email to webdriver+...@__googlegroups.com____.
> >>
> >> To post to this group, send email to webd...@googlegroups.com
> <mailto:webd...@googlegroups.com>.
> >>
> >> Visit this group at http://groups.google.com/__group____/webdriver
> >> <http://groups.google.com/group/webdriver>.
> >> For more options, visit https://groups.google.com/d/__op____tout
> >> <https://groups.google.com/d/optout>.
> >
> > --
> > You received this message because you are subscribed to a topic in the
> > Google Groups "webdriver" group.
> > To unsubscribe from this topic, visit
> >
> https://groups.google.com/d/__to____pic/webdriver/HtHYGCD6jPM/__unsu____bscribe
> > <https://groups.google.com/d/topic/webdriver/HtHYGCD6jPM/unsubscribe>.
> > To unsubscribe from this group and all its topics, send an email to
> > webdriver+...@__googlegroups.com____.
> > To post to this group, send email to webd...@googlegroups.com
> <mailto:webd...@googlegroups.com>.
> >
> > Visit this group at http://groups.google.com/__group____/webdriver
> > <http://groups.google.com/group/webdriver>.
> > For more options, visit https://groups.google.com/d/__op____tout
> > <https://groups.google.com/d/optout>.
> >
> >
> > --
> > You received this message because you are subscribed to a topic in the Google
> > Groups "webdriver" group.
> > To unsubscribe from this topic, visit
> > https://groups.google.com/d/__to__pic/webdriver/HtHYGCD6jPM/__unsu__bscribe
> > <https://groups.google.com/d/topic/webdriver/HtHYGCD6jPM/unsubscribe>.
> > To unsubscribe from this group and all its topics, send an email to
> > webdriver+...@__googlegroups.com__.
> > To post to this group, send email to webd...@googlegroups.com
> <mailto:webd...@googlegroups.com>.
> > Visit this group at http://groups.google.com/__group__/webdriver
> > <http://groups.google.com/group/webdriver>.
> > For more options, visit https://groups.google.com/d/__op__tout
> > <https://groups.google.com/d/optout>.
> >
> >
> > --
> > You received this message because you are subscribed to a topic in the Google Groups
> > "webdriver" group.
> > To unsubscribe from this topic, visit
> > https://groups.google.com/d/__topic/webdriver/HtHYGCD6jPM/__unsubscribe
> > <https://groups.google.com/d/topic/webdriver/HtHYGCD6jPM/unsubscribe>.
> > To unsubscribe from this group and all its topics, send an email to
> > webdriver+...@__googlegroups.com <http://googlegroups.com>.
> > To post to this group, send email to webd...@googlegroups.com
> <mailto:webd...@googlegroups.com>.
> > Visit this group at http://groups.google.com/__group/webdriver
> > <http://groups.google.com/group/webdriver>.
> > For more options, visit https://groups.google.com/d/__optout
> > <https://groups.google.com/d/optout>.
> >
> >
> > --
> > You received this message because you are subscribed to a topic in the Google Groups
> "webdriver"
> > group.
> > To unsubscribe from this topic, visit
> > https://groups.google.com/d/topic/webdriver/HtHYGCD6jPM/unsubscribe.
> > To unsubscribe from this group and all its topics, send an email to
> > webdriver+...@googlegroups.com <mailto:webdriver%2Bunsu...@googlegroups.com>
> <mailto:webdriver+...@googlegroups.com <mailto:webdriver%2Bunsu...@googlegroups.com>>.
> > To post to this group, send email to webd...@googlegroups.com
> <mailto:webd...@googlegroups.com> <mailto:webd...@googlegroups.com
> <mailto:webd...@googlegroups.com>>.
> > Visit this group at http://groups.google.com/group/webdriver.
> > For more options, visit https://groups.google.com/d/optout.
> >
> >
> > --
> > You received this message because you are subscribed to the Google Groups "webdriver" group.
> > To unsubscribe from this group and stop receiving emails from it, send an email to
> > webdriver+...@googlegroups.com <mailto:webdriver%2Bunsu...@googlegroups.com>
> <mailto:webdriver+...@googlegroups.com <mailto:webdriver%2Bunsu...@googlegroups.com>>.
> > To post to this group, send email to webd...@googlegroups.com
> <mailto:webd...@googlegroups.com> <mailto:webd...@googlegroups.com
> <mailto:webd...@googlegroups.com>>.
> > Visit this group at http://groups.google.com/group/webdriver.
> > For more options, visit https://groups.google.com/d/optout.
>
>
> --
> ------------------------------------------------------------------------ -
> Chris Merrill | Web Performance, Inc.
> ch...@webperformance.com <mailto:ch...@webperformance.com> |
> http://webperformance.com
> 919-433-1762 | 919-845-7601
>
> Web Performance: Website Load Testing Software & Services
> ------------------------------------------------------------------------ -
>
> --
> You received this message because you are subscribed to a topic in the Google Groups "webdriver"
> group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/webdriver/HtHYGCD6jPM/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> webdriver+...@googlegroups.com <mailto:webdriver%2Bunsu...@googlegroups.com>.

Kandurke Vinayak

unread,
Apr 28, 2014, 11:43:33 AM4/28/14
to webd...@googlegroups.com
Hi Chris,
 thanks for reply. I used

WebElement elements = driver.findElements(By.className("div.x-form-arrow-trigger")).get(2);

System.out.println("Number of elements: "+elements.getSize());

it is returning zero size.I am new to this, I may be wrong .Please Reply.



To unsubscribe from this group and all its topics, send an email to webdriver+...@googlegroups.com.
To post to this group, send email to webd...@googlegroups.com.

Sean Adkinson

unread,
Apr 28, 2014, 12:02:57 PM4/28/14
to webd...@googlegroups.com
"div.x-form-arrow-trigger" is not a class name.  Use the class name in By.className().  The class name is "x-form-arrow-trigger".  

-Sean
Reply all
Reply to author
Forward
0 new messages