I have Application in which When I record new Window then it does not identify the actual Window by Record Window Declaration

I found Problem that Whatever Window I am recording is embeded in some Window. So for this window to record I have to Record it as test frame so that It will give me Main Window declaration

In Second step I have to record same Window Through REcord Window Declaration so that it will give me MAin window recorded earlier as Parent Window.

Please let me know What is the ideal Solution for avoiding Duplicate Recording of same Window first as MAin Window and Second time from REcord Window Delaration.

Please let me know what could be the reason for identifying Multiple window as main Window