Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to capture dynamically changing element ids of a text box?
#1
Not Solved
Hi,
I am writing scripts for a web page, which has 7 edit boxes. The element id of each box is unique. The element ids are changing dynamically each time you invoke the page. I inspected the properties of the edit boxes using developer tool bar and below are the details:
Code:
EditBox1 : <input type="text" title="ETC: 6.40" alt="ETC: 6.40" class="formFieldNoWidth" maxlength="" size="4" value="" id="d91519e189" name="actuals_hours">
EditBox2: <input type="text" title="ETC: 6.40" alt="ETC: 6.40" class="formFieldNoWidth" maxlength="" size="4" value="" id="d91519e198" name="actuals_hours">
EditBox3: <input type="text" title="ETC: 6.40" alt="ETC: 6.40" class="formFieldNoWidth" maxlength="" size="4" value="" id="d91519e206" name="actuals_hours">
I cleared the caches of the page and again invoke the same page. Now I inspect the same edit boxes using Developer tool bar. Now the element ids of the pages have been changed. Below are the details:
Code:
EditBox1 : <input type="text" title="ETC: 6.40" alt="ETC: 6.40" class="formFieldNoWidth" maxlength="" size="4" value="" id="d96132e187" name="actuals_hours">
EditBox2: <input type="text" title="ETC: 6.40" alt="ETC: 6.40" class="formFieldNoWidth" maxlength="" size="4" value="" id="d96132e196" name="actuals_hours">
EditBox3: <input type="text" title="ETC: 6.40" alt="ETC: 6.40" class="formFieldNoWidth" maxlength="" size="4" value="" id="d96132e204" name="actuals_hours">
Can you please suggest , how can I write the script in such a way that even if the element id changes should not affect my script? I have been asked to write the script using element id only.
Regards,
Pinaki
Reply


Messages In This Thread
How to capture dynamically changing element ids of a text box? - by pmishra - 06-29-2011, 02:21 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  UFT issues with Outsystems dynamically generated Id/names jherron 2 1,132 03-02-2020, 09:33 PM
Last Post: Swishy70
  Unable to capture value of Webelement which is changing dynamically sheetal 9 15,671 02-16-2018, 11:01 AM
Last Post: janki_kakadia
  How can we get the Windows application Text box background color Using UFT 11.53 Kuppampattu 3 5,703 06-06-2017, 11:12 AM
Last Post: workrohit08
  Unable to click on dynamically changing webelement preeti 0 1,703 04-29-2017, 08:50 PM
Last Post: preeti
  Page element keep changing chong67 4 4,304 11-08-2016, 09:17 PM
Last Post: Paul Rammone

Forum Jump:


Users browsing this thread: 1 Guest(s)