Close Menu
    DevStackTipsDevStackTips
    • Home
    • News & Updates
      1. Tech & Work
      2. View All

      Sunshine And March Vibes (2025 Wallpapers Edition)

      May 16, 2025

      The Case For Minimal WordPress Setups: A Contrarian View On Theme Frameworks

      May 16, 2025

      How To Fix Largest Contentful Paint Issues With Subpart Analysis

      May 16, 2025

      How To Prevent WordPress SQL Injection Attacks

      May 16, 2025

      Microsoft has closed its “Experience Center” store in Sydney, Australia — as it ramps up a continued digital growth campaign

      May 16, 2025

      Bing Search APIs to be “decommissioned completely” as Microsoft urges developers to use its Azure agentic AI alternative

      May 16, 2025

      Microsoft might kill the Surface Laptop Studio as production is quietly halted

      May 16, 2025

      Minecraft licensing robbed us of this controversial NFL schedule release video

      May 16, 2025
    • Development
      1. Algorithms & Data Structures
      2. Artificial Intelligence
      3. Back-End Development
      4. Databases
      5. Front-End Development
      6. Libraries & Frameworks
      7. Machine Learning
      8. Security
      9. Software Engineering
      10. Tools & IDEs
      11. Web Design
      12. Web Development
      13. Web Security
      14. Programming Languages
        • PHP
        • JavaScript
      Featured

      The power of generators

      May 16, 2025
      Recent

      The power of generators

      May 16, 2025

      Simplify Factory Associations with Laravel’s UseFactory Attribute

      May 16, 2025

      This Week in Laravel: React Native, PhpStorm Junie, and more

      May 16, 2025
    • Operating Systems
      1. Windows
      2. Linux
      3. macOS
      Featured

      Microsoft has closed its “Experience Center” store in Sydney, Australia — as it ramps up a continued digital growth campaign

      May 16, 2025
      Recent

      Microsoft has closed its “Experience Center” store in Sydney, Australia — as it ramps up a continued digital growth campaign

      May 16, 2025

      Bing Search APIs to be “decommissioned completely” as Microsoft urges developers to use its Azure agentic AI alternative

      May 16, 2025

      Microsoft might kill the Surface Laptop Studio as production is quietly halted

      May 16, 2025
    • Learning Resources
      • Books
      • Cheatsheets
      • Tutorials & Guides
    Home»Development»Selecting element value from drop down list with selenium using POM

    Selecting element value from drop down list with selenium using POM

    June 21, 2024

    I’m trying to make a simple test to register in website – https://www.midomi.com/. I’m using c# and selenium but have stuck in selecting values from a dropdown list using Page object model. My project contains test class and page object folder with two classes inside her – home page and register page.

    Register page: here I’m having problem to implement code to selecting values from the dropdown list

    namespace MidomiRegisterPOM.PageObject
    {
    class RegisterPage
    {
    private IWebDriver driver;

    //type your email
    [FindsBy(How = How.Id, Using = “email”)]
    [CacheLookup]
    public IWebElement Email { get; set; }

    //type your username
    [FindsBy(How = How.Id, Using = “username”)]
    [CacheLookup]
    public IWebElement UserName { get; set; }

    //type your password
    [FindsBy(How = How.Id, Using = “password”)]
    [CacheLookup]
    public IWebElement Password { get; set; }

    //confirm your password
    [FindsBy(How = How.Id, Using = “confirm_password”)]
    [CacheLookup]
    public IWebElement ConfirmPassword { get; set; }

    //here select from dropdown list your birth day, month and year

    //mark privacy notice checkbox
    [FindsBy(How = How.Id, Using = “tos_pp”)]
    [CacheLookup]
    public IWebElement PrivacyNotice { get; set; }

    //click Continue button
    [FindsBy(How = How.Id, Using = “submitLink”)]
    [CacheLookup]
    public IWebElement ContinueButton { get; set; }

    public RegisterPage(IWebDriver driver)
    {
    this.driver = driver;
    PageFactory.InitElements(driver, this);
    }
    public void RegisterToSite()
    {
    Email.SendKeys(“testing@gmail.com”);
    UserName.SendKeys(“Tester”);
    Password.SendKeys(“testing”);
    ConfirmPassword.SendKeys(“testing”);
    ContinueButton.Submit();
    }

    I’m trying this but got an error:

    Is there any way to select it with [FindsBy] like I’m selecting email, username and password field? Thanks

    Here is my code without using POM:

    var birthMonth = driver.FindElement(By.Id(“birth_month”));
    var selectMonth = new SelectElement(birthMonth);
    selectMonth.SelectByValue(“5”);

    Source: Read More

    Facebook Twitter Reddit Email Copy Link
    Previous ArticleTest Automation for different user roles within an application – Selenium and C#
    Next Article Leveraging Machine Learning and Process-Based Models for Soil Organic Carbon Prediction: A Comparative Study and the Role of ChatGPT in Soil Science

    Related Posts

    Security

    Nmap 7.96 Launches with Lightning-Fast DNS and 612 Scripts

    May 17, 2025
    Common Vulnerabilities and Exposures (CVEs)

    CVE-2025-4831 – TOTOLINK HTTP POST Request Handler Buffer Overflow Vulnerability

    May 17, 2025
    Leave A Reply Cancel Reply

    Continue Reading

    Windows 11 24H2 Wi-Fi DHCP internet issue is still not fixed, headache for sysadmins

    Development

    OpenAI announces “SearchGPT” to try and stay at the front of the pack

    Artificial Intelligence

    10 Tips for Using Your LinkedIn Profile to the Best Advantage (Free Download)

    News & Updates

    Leveraging technology on the frontlines of emergency: How communities of developers are taking action

    Development

    Highlights

    Update PyTorch ASAP | Kaspersky official blog

    April 22, 2025

    Update PyTorch ASAP | Kaspersky official blog

    vulnerability
    Researchers have found a way to exploit a security mechanism in a popular machine-learning framework.
    April 22, 2025
    A researcher has discovered a vulnerability in PyTorch – an open-sour …
    Read more

    Published Date:
    Apr 22, 2025 (2 hours, 48 minutes ago)

    Vulnerabilities has been mentioned in this article.

    CVE-2025-32434

    CVE-2018-8611

    How DNS Works: A Guide to Understanding the Internet’s Address Book

    May 14, 2025

    Dell’s confusing rebrand is highlighted by these otherwise lovely looking laptops

    January 6, 2025

    Parrot: Optimizing End-to-End Performance in LLM Applications Through Semantic Variables

    June 3, 2024
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.