FAQ
Hello,

Must click one of the options below, but the command is not working

<div class="inner-field second">
<label class="select">
<select id="Payment-CreditCard-ExpirationYear" autocomplete="off" name="
Payment[CreditCard][CC][ExpYear]">
<option value="2013">2013</option>
<option value="2014">2014</option>
<option value="2015">2015</option>
<option value="2016">2016</option>
<option value="2017">2017</option>
<option value="2018">2018</option>
<option value="2019">2019</option>
<option value="2020">2020</option>
<option value="2021">2021</option>
<option value="2022">2022</option>
<option value="2023">2023</option>
</select>
</label>
</div>

I try the following:

driver.findElement(By.id("Payment-CreditCard-ExpirationYear")).click();
driver.findElement(By.xpath("//*[@value='2015']")).click();


can anyone help me?

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/e4161256-52df-4aa8-b19c-04ca150e4324%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Sivakumar K at Jul 29, 2013 at 4:16 pm
    Hi,

    you can try with the following code:-

    Select selObj = new Select(WebElement);
    selObj.selectByValue("2015")

    On Mon, Jul 29, 2013 at 3:28 PM, ra cras wrote:

    Hello,

    Must click one of the options below, but the command is not working

    <div class="inner-field second">
    <label class="select">
    <select id="Payment-CreditCard-ExpirationYear" autocomplete="off" name="
    Payment[CreditCard][CC][ExpYear]">
    <option value="2013">2013</option>
    <option value="2014">2014</option>
    <option value="2015">2015</option>
    <option value="2016">2016</option>
    <option value="2017">2017</option>
    <option value="2018">2018</option>
    <option value="2019">2019</option>
    <option value="2020">2020</option>
    <option value="2021">2021</option>
    <option value="2022">2022</option>
    <option value="2023">2023</option>
    </select>
    </label>
    </div>

    I try the following:

    driver.findElement(By.id("Payment-CreditCard-ExpirationYear")).click();
    driver.findElement(By.xpath("//*[@value='2015']")).click();


    can anyone help me?

    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to selenium-users+unsubscribe@googlegroups.com.
    To post to this group, send email to selenium-users@googlegroups.com.
    To view this discussion on the web visit
    https://groups.google.com/d/msgid/selenium-users/e4161256-52df-4aa8-b19c-04ca150e4324%40googlegroups.com
    .
    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 unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
    To post to this group, send email to selenium-users@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CACPQJMK%3Dyz6y2bnXbvPKHFxU_btDQ9bo6PP%2Bp0pZ10ogw5kO0Q%40mail.gmail.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Ra cras at Jul 29, 2013 at 8:08 pm
    I tried here but could not, as I implement this?
    Em segunda-feira, 29 de julho de 2013 13h10min47s UTC-3, sivakumar escreveu:

    Hi,

    you can try with the following code:-

    Select selObj = new Select(WebElement);
    selObj.selectByValue("2015")


    On Mon, Jul 29, 2013 at 3:28 PM, ra cras <rafae...@gmail.com <javascript:>
    wrote:
    Hello,

    Must click one of the options below, but the command is not working

    <div class="inner-field second">
    <label class="select">
    <select id="Payment-CreditCard-ExpirationYear" autocomplete="off" name="
    Payment[CreditCard][CC][ExpYear]">
    <option value="2013">2013</option>
    <option value="2014">2014</option>
    <option value="2015">2015</option>
    <option value="2016">2016</option>
    <option value="2017">2017</option>
    <option value="2018">2018</option>
    <option value="2019">2019</option>
    <option value="2020">2020</option>
    <option value="2021">2021</option>
    <option value="2022">2022</option>
    <option value="2023">2023</option>
    </select>
    </label>
    </div>

    I try the following:

    driver.findElement(By.id("Payment-CreditCard-ExpirationYear")).click();
    driver.findElement(By.xpath("//*[@value='2015']")).click();


    can anyone help me?

    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to selenium-user...@googlegroups.com <javascript:>.
    To post to this group, send email to seleniu...@googlegroups.com<javascript:>
    .
    To view this discussion on the web visit
    https://groups.google.com/d/msgid/selenium-users/e4161256-52df-4aa8-b19c-04ca150e4324%40googlegroups.com
    .
    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 unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
    To post to this group, send email to selenium-users@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/ec567412-b8c3-4fb6-bdb3-1fb832c7cca1%40googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Dave at Jul 29, 2013 at 8:41 pm
    I wrote up a tip with example code for selecting drop downs. You can find
    it here <http://elemental-selenium.com/tips/5-select-from-a-dropdown>.
    On Monday, July 29, 2013 4:08:37 PM UTC-4, ra cras wrote:

    I tried here but could not, as I implement this?

    Em segunda-feira, 29 de julho de 2013 13h10min47s UTC-3, sivakumar
    escreveu:
    Hi,

    you can try with the following code:-

    Select selObj = new Select(WebElement);
    selObj.selectByValue("2015")

    On Mon, Jul 29, 2013 at 3:28 PM, ra cras wrote:

    Hello,

    Must click one of the options below, but the command is not working

    <div class="inner-field second">
    <label class="select">
    <select id="Payment-CreditCard-ExpirationYear" autocomplete="off" name="
    Payment[CreditCard][CC][ExpYear]">
    <option value="2013">2013</option>
    <option value="2014">2014</option>
    <option value="2015">2015</option>
    <option value="2016">2016</option>
    <option value="2017">2017</option>
    <option value="2018">2018</option>
    <option value="2019">2019</option>
    <option value="2020">2020</option>
    <option value="2021">2021</option>
    <option value="2022">2022</option>
    <option value="2023">2023</option>
    </select>
    </label>
    </div>

    I try the following:

    driver.findElement(By.id("Payment-CreditCard-ExpirationYear")).click();
    driver.findElement(By.xpath("//*[@value='2015']")).click();


    can anyone help me?

    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To unsubscribe from this group and stop receiving emails from it, send
    an email to selenium-user...@googlegroups.com.
    To post to this group, send email to seleniu...@googlegroups.com.
    To view this discussion on the web visit
    https://groups.google.com/d/msgid/selenium-users/e4161256-52df-4aa8-b19c-04ca150e4324%40googlegroups.com
    .
    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 unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
    To post to this group, send email to selenium-users@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/9f386eb9-4ca9-4eea-bc9c-dad1f9fb7505%40googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupselenium-users @
categoriesselenium
postedJul 29, '13 at 2:28p
activeJul 29, '13 at 8:41p
posts4
users3
websiteseleniumhq.org

3 users in discussion

Ra cras: 2 posts Sivakumar K: 1 post Dave: 1 post

People

Translate

site design / logo © 2022 Grokbase