Micro Focus QTP (UFT) Forums
UFT issues with Outsystems dynamically generated Id/names - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: UFT issues with Outsystems dynamically generated Id/names (/Thread-UFT-issues-with-Outsystems-dynamically-generated-Id-names)



UFT issues with Outsystems dynamically generated Id/names - jherron - 02-14-2020

Good evening all,   I was recently given a large number of UFT scripts to maintain (and very little training on how to do so).   One of the scripts is for a webpage developed on the Outsystems platform.  Outsystems dynamically generated ids and names for elements on the web screens and every time a new version is published many of the names/ids change.   I'm trying to determine if there is some way I can update these scripts so when the name changes my scripts won't continually break.

Below is an example of an input field that we use in the script.   Last month It was OutsystemsUIWeb_wt16 this month it changed to 17.   My assumption is each time there is a new release that value will continue to increment.   I notice that every month the name and Id both end with wtUserNameInput but I can't figure out a way to only look at that portion of the name or Id in my script.   I tried just saying *.wtUserNameInput but when the script runs the input is not found.   Any suggestions?

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"


RE: UFT issues with Outsystems dynamically generated Id/names - Swishy70 - 03-02-2020

Look at the \d option to handle dynamically changing values. I've not used it but I have seen several posts about it in these forums.


RE: UFT issues with Outsystems dynamically generated Id/names - Swishy70 - 03-02-2020

I've not used the feature but I have seen several posts about using "\d" to dynamically handle numbers that change.

My guess is name=OutSystemsUIWeb_wt\d\d$block$wtLogin$OutSystemsUIWeb_wt\d\d$block$wtLogin$OutSystemsUIWeb_wt\d\d$block$wtInput$wtUserNameInput" type="text" id="OutSystemsUIWeb_wt\d\d_block_wtLogin_OutSystemsUIWeb_wt\d\d_block_wtLogin_OutSystemsUIWeb_wt\d\d_block_wtInput_wtUserNameInput" tabindex="5"

From what I've read, each "\d" handles 1 dynamically changing number.