Hello Silk Nation,
I have an application that is throwing dynamic objects at me. Either a 3 digit or 4 digit number as part of the name. Using a ? helps me handle the number change, but not the 3 to 4 digit change. I have defined 2 objects:
c13_securitiesClass //select[@id='c???_securitiesClass']
c14_securitiesClass //select[@id='c????_securitiesClass']
And have the following code to handle it:
Try
.DomListBox("c13_securitiesClass").Select(Noteid)
.DomTextField("c23_fromMaturityDat").SetText(Dte)
.DomTextField("c33_toMaturityDate").SetText(Dte)
Catch ex As Exception
.DomListBox("c14_securitiesClass").Select(Noteid)
.DomTextField("c24_fromMaturityDat").SetText(Dte)
.DomTextField("c34_toMaturityDate").SetText(Dte)
EndTry
Is there a better way I can be doing this? I'm worried about more or less digits being added dynamically to the name.
Can I "detect" the length and react accordingly?
Thank-You!