Lieutenant Commander
Lieutenant Commander
414 views

Running JavaScript in a particular iFrame to override UI controls and enter form data with TruClient

I'm running a test against a Microsoft Dynamics 365 Application (using LoadRunner 12.63) where contacts need to be created and then various actions processed on those contacts.  There is a Client Side LOCK on some of the fields of newly created contacts that can easily be 'unlocked' using developer tools.  While I can ask the Database team to 'unlock' every contact for me, I would rather figure out how to override the lock with VUGen, as I expect that I should be able to do anything in VUGen that I can do with Developer Tools in Chrome.

To make the required Client Side changes with Developer Tools, I do the following:

Select the iFrame with a label:  customScriptsFrame(ClientApoWrapper.aspx)

Run the following in the Console to unlock the field: formContext.getControl('ndss_bgtsapproval').setDisabled(false); 

Run the following to set the required value in the field:  Xrm.Page.getAttribute("ndss_bgtsapproval").setValue(814060001);

Simply selecting the form object appears to select the correct object (iFrame) but when running the JavaScript, it is clear that the object has not been selected correctly, because the error that is returned ("formcontext is not defined") is the same error that is returned if the correct iFrame is not selected from Developer Tools.

The following graphic shows the steps taken to make the UI change with developer tools, including an attempt to update the field before the correct iFrame is selected.

I'm keen to know how to select the appropriate iFrame using TruClient so that I can run the required JavaScript to update the on screen field as required.  (note that none of the data in the screenshots is real - it is all completely manufactured)

 Image showing developer tools steps to update the UI field

Many thanks in advance.

0 Likes
0 Replies
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.