Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8156773
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T17:03:50+00:00 2026-06-06T17:03:50+00:00

I have a webpage where there are few text fields to be filled up

  • 0

I have a webpage where there are few text fields to be filled up with some values using Selenium WebDriver. But I’m unable to fetch these items using the APIs provided in selenium framwework because the IDs are changing dynamically.

For example one of the text fields has the following ID

<input id="order_unit_line_rate_806099_unit_price" type="text" value="" uniqueattr="Dynamic Site Accelerator / Dynamic Site Accelerator / Platform Fee / / Price" size="10" onchange="javascript:numberFormatValid('order_unit_line_rate_806099_unit_price', parseI18nNumber($('order_unit_line_rate_806099_unit_price').value, ',', '.'), 5, '.');" name="order_unit_line_rate[806099][unit_price]">

where the digits 806099 which is a part of the id varies for every new page and every new text box. I didn’t have any luck by using the findElements(By.id()) API.

can someone please suggest any approach for identifying these elements.

I’m using eclipse as the editor, java as the client driver and selenium webDriver as the automation framework.

Thanks
Kiran

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T17:03:51+00:00Added an answer on June 6, 2026 at 5:03 pm

    You can use findElementsByTagName and then loop over each returned element, checking its ID versus your regular expression:

    public static WebElement findElementByRegexId(FindsByTagName ctx, String tagName, String regex) {
        List<WebElement> l = ctx.findElementsByTagName(tagName);
        for (WebElement e : l) {
            if (e.getAttribute("id").matches(regex)) {
                return e;
            }
        }
        return null;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a webpage that has 3 file inputs. There are specific fields on
I have some localization problems in my webpage. There are basically two problems (that
I have a webpage that is a Search page. There are a few pre-defined
I have a webpage where there are two buttons and a textbox. When the
We have a system built on seam/richfaces. There's this webpage where the tables are
Say I have an anchor on a webpage like so: <a name=comegetit></a> Is there
I have a simple rails webpage where a user enters in a few textfields
I have data grids on my webpage that need to be refreshed every few
I have a web page that has a few text boxes, and a dual
I have a form with a few fields. When you submit the form, the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.