Highlighted
Absent Member.
Absent Member.
279 views

How to debug a recorded step in detail with TruClient - specifically setting a file for upload

Hi,

I am recording a basic file upload on our site, I've got a number of steps set up which have been recorded. The file upload item on the page is based around angular / Javascript so it's not a straight forward HTML element.

My recording...

  • Navigate to www.mywebsite.com
  • Click on "Click here to browse" [this opens the browsers file dialog, I navigate and select my file]
  • Set c:\temp\myfile.xls on filebox (1) filebox

The initial problem I have is that after the browsers dialog is open it cannot be closed - I've been searching around for this and can't find a way to close the dialog, I've emailed our technical liason manager at HP and received no help.

The next step from the recording "Set .... on filebox(1) filebox" works, so the file get's uploaded. - success!

My thoughts are that I should disable the "Click to browse step" and just keep the "Set c:\temp\myfile.xls on filebox (1) file box." If I isolate that step and reply, it keeps uploading, however if I refresh the screen, then run the step it fails, it doesn't seem to be able to find the correct object again.

So I am stuck because I don't know exactly how it is identifying the item successfully the first time and subsequent time single step replays and then failing if I run that step again after a browser refresh. 

How can I inspect the details of the "Set ....on filebox(1) filebox" ? If I switch to Xpath or Javascript I can see there are long paths which I assume are valid but when I try play back , it doesn't work. 

I've tried using the descriptors with classes, Id's on the objects I assume it needs but nothing seems to work - UNLESS I replay the script and include the "Click here to Browse". 

 

 

0 Likes
1 Reply
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Re: How to debug a recorded step in detail with TruClient - specifically setting a file for upload

 Hi,

The trick that allows overcoming this issue is usually to perform what the application is doing when you click the button that opens the browse dialog without actually clicking it. It can be done by understanding what the application is doing and immitate that using TruClient"Evalaute JavaScript" step.

The code in the "Evaluate JavaScript" step should probably add the <INPUT type=file ... </> element to the DOM and maybe do a bit more in order to allow the Set File step to succeed later and allow successful upload.

There is no generic workaround for that, otherwise it would have been productized by now.

I suggest contacting HPE support team to get help

Regards,

Shlomi

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