Highlighted
Jherron78
New Member.
414 views

Regular Expression in Web Element name being ignored

Jump to solution

Good morning all, I was recently given a number of scripts to maintain in UFT.   (but no training on how the tool actually works)   For the most part I can struggle along by recording web application screen actions and then modifying as necessary; however we have some applications created in Outystems where the id and name of web screen inputs is dynamically generated, so the scripts are constantly breaking.

An example of a user Input is below.   The OutsystemsUIWeb_wt16, 17, 28 in the name and id change on a regular basis, so the element in the local repository is no longer valid.   I have tried updated the repository entry in UFT to use a regular expression but it doesn't seem to be working.   Since the name/id always end in wtUserInput I updated properties to use Regular Expression and entered wtUserNameInput$.   But its not being found when the script runs.   Any ideas?

<input name="OutSystemsUIWeb_wt16$block$wtLogin$OutSystemsUIWeb_wt17$block$wtLogin$OutSystemsUIWeb_wt28$block$wtInput$wtUserNameInput" type="text" id="OutSystemsUIWeb_wt16_block_wtLogin_OutSystemsUIWeb_wt17_block_wtLogin_OutSystemsUIWeb_wt28_block_wtInput_wtUserNameInput" tabindex="5" class="input OSFillParent" onkeydown="return OsEnterKey('OutSystemsUIWeb_wt16_block_wtLogin_OutSystemsUIWeb_wt17_block_wtLogin_wt15', arguments[0] || window.event);" aria-invalid="false" style="font-size: 18px; font-weight: bold; height: 50px; padding: 30px 0px 4px 0px;">

 

0 Likes
1 Solution

Accepted Solutions
Knowledge Partner
Knowledge Partner

Re: Regular Expression in Web Element name being ignored

Jump to solution

Oops, my mistake, that should be use:

.*wtUserNameInput

Mark. 

View solution in original post

0 Likes
5 Replies
Knowledge Partner
Knowledge Partner

Re: Regular Expression in Web Element name being ignored

Jump to solution

Your on the right track @Jherron78  replace the $ with .* and that should work.

Mark Smith

0 Likes
Knowledge Partner
Knowledge Partner

Re: Regular Expression in Web Element name being ignored

Jump to solution

Oops, my mistake, that should be use:

.*wtUserNameInput

Mark. 

View solution in original post

0 Likes
Jherron78
New Member.

Re: Regular Expression in Web Element name being ignored

Jump to solution

Thank you so much!   Everything I was reading said to use $ if you wanted to use a regex that evaluated a string ending with a certain value.   when is it appropriate to use the $?

0 Likes
Knowledge Partner
Knowledge Partner

Re: Regular Expression in Web Element name being ignored

Jump to solution

I've never used $ I've always used .*

Sorry I don't know when $ is appropriate.

Mark Smith.

0 Likes
Micro Focus Contributor
Micro Focus Contributor

Re: Regular Expression in Web Element name being ignored

Jump to solution

Hello Jherron78,

It is possible that you are missing escaped characters in your regex expression. Because $ symbol is a special character in regex expression. The correct value should be:

wtUserNameInput\$

 Please try and see if it helps for you issue.

Thanks
Martin

The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.