hi all,

I need a common function java so that i can select a record from dropdown
box.

Can anyone please help me out, how to do that in webdriver

Thanks in advance,

Regards,
Bharath

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to selenium-users@googlegroups.com.
To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/85f9_z-uxmMJ.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Krishnan Mahadevan at Aug 30, 2012 at 5:31 am
    What do you have as code right now for doing this ?
    All you would need to do is wrap the specific code that you would use to
    interact with a drop down into a method and have the method take in

    3 parameters : WebDriver instance, Locator String/Locator strategy
    [subclass of By], Value to select in the dropdown

    Thanks & Regards
    Krishnan Mahadevan

    "All the desirable things in life are either illegal, expensive, fattening
    or in love with someone else!"


    On Thu, Aug 30, 2012 at 10:49 AM, Bharath Raj wrote:

    hi all,

    I need a common function java so that i can select a record from dropdown
    box.

    Can anyone please help me out, how to do that in webdriver

    Thanks in advance,

    Regards,
    Bharath

    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to
    selenium-users+unsubscribe@googlegroups.com.
    To view this discussion on the web visit
    https://groups.google.com/d/msg/selenium-users/-/85f9_z-uxmMJ.
    For more options, visit https://groups.google.com/groups/opt_out.

    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Justin Gourley at Aug 30, 2012 at 6:41 pm
    Had some stuff handy so figured I would share here:


    public void select(String locator, String locatorType, String optionLabel) {
    Select dropList = new Select(getWebElement(locator, locatorType));
    dropList.selectByVisibleText(optionLabel);
    }

    public void selectByValue(String locator, String locatorType, String
    value) {
    Select dropList = new Select(getWebElement(locator, locatorType));
    dropList.selectByValue(value);
    }

    public void selectByIndex(String locator, String locatorType, int
    index) {
    Select dropList = new Select(getWebElement(locator, locatorType));
    dropList.selectByIndex(index);
    }

    On Wed, Aug 29, 2012 at 10:19 PM, Bharath Raj wrote:

    hi all,

    I need a common function java so that i can select a record from dropdown
    box.

    Can anyone please help me out, how to do that in webdriver

    Thanks in advance,

    Regards,
    Bharath

    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to
    selenium-users+unsubscribe@googlegroups.com.
    To view this discussion on the web visit
    https://groups.google.com/d/msg/selenium-users/-/85f9_z-uxmMJ.
    For more options, visit https://groups.google.com/groups/opt_out.

    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupselenium-users @
categoriesselenium
postedAug 30, '12 at 5:19a
activeAug 30, '12 at 6:41p
posts3
users3
websiteseleniumhq.org

People

Translate

site design / logo © 2022 Grokbase