cancel
Showing results for 
Search instead for 
Did you mean: 

Mainframe Global Send Key Problem

EricLiu
Level 5
Hi guys, I am working on a process that involves mainframe. I am using Micro Focus Reflection 9.X and earlier (COM API). I run into a problem that he global send key will not work once I loose focus on the terminal window. For example, I click on my browser when the process is running, or there is a pop up from somewhere else. Actually, global send keys, global send key events and set cursor position all stopped working. Launch and terminate still work tho. There is no activate window in navigate stage so it seems nothing I can do to fix this... Has anyone experienced similar issue like this? Is there a work around? Thanks.
8 REPLIES 8

blue_meanie
Level 6
This is how a PC works!   If you click on a browser, then you type things on your keyboard, would you expect what you typed to appear on the mainframe window?  :)   You should be able to spy the whole window in Win32 mode, then Activate this prior to performing the Sendkeys.  You get used to this developer discipline the more you use it.

EricLiu
Level 5
Hi Blue_Meanie, I know how a PC works.  My point is, with region mode I can activate window with Blue Prism navigate stage to make sure the cursor is in correct place. With html mode, Blue Prism can find the correct element once it is properly defined, no matter where the focus is. Working with mainframe, there is no option to activate this window with navigate stage. This make interacting with terminal very unsafe. Any unexpected pop up will easily break the process. The only work around will be terminate and re-launch. What version are you using? I am using version 6.4.2, mainframe application, Micro Focus Reflection 9.X and earlier (COM API). There is no such thing as activation prior to performing the SendKeys, sir.  

John__Carter
Staff
Staff
Peace! We're all friends here. How about creating an object that attaches to the mainframe as if it was a windows app, spy the main window and create a page called Activate. Then call this new object from the original object.

EricLiu
Level 5
Thanks John! I really appreciate it. I will go on and try this. 

DhruvinPatel
Level 3
Hi Eric, I had one process where I was able to work with Browser and Mainframe back to back. As you mentioned in original thread, launch/ terminate is working fine so BP is attached to Mainframe session correctly. If you see option 'Mainframe Send Keys' in navigation stage, use that instead of 'Global Send Keys'. In my experience, we don't need to activate mainframe session, only attach is required. Try checking if Mainframe Mnemonic (send keys text) in respective emulator documentation that you are using is correct or not. Could you share the error that you're getting? - Dhruvin

EricLiu
Level 5
Hi Dhruvin, Thanks for replying. I can share some info with you, but I do not really have errors. Let me know what do you want to see. It is the situation that sending key stroke is not safely limited to the terminal "handle" makes me worry. If the send key does not work as intended, the process will not function properly or not functional at all. I do not have the option 'Mainframe Send Keys' in navigation stage. I use write stage a lot to avoid using send keys as much as I can. But {ENTER}, {F1}, {F2} ... has to be entered by navigation stage. Eventually, my work around is using conditional wait to check every time I try to send a key stroke, before and after. I made a text type data field, to record the status how far I have gone into the process, so if the input failed I can terminate and launch again and go to the proper step according to my status log. Naturally, the focus is on the terminal window after it is launched. It is not an elegant way to solve this problem, but it is working fine... for now... fingers crossed

BenKirimlidis
Level 7
Hi Eric, We've had the same kind of issue.  Including a delay was the same solution we came up with and it hsa worked reasonably well.  Great minds and all that!

EricLiu
Level 5
Hey Ben, Good to hear you sorted it out. I do have delays all over the place, timed delays and conditional delays. But it did not solve my problem. Hope someday a newer version Blue Prism can be very easy to work with and does not have too many unclear bugs. Thanks Ben.