Forum Discussion

andy_cheetham's avatar
andy_cheetham
Occasional Contributor
10 years ago

Name used to map a control changes between recording and running a test

This all happens on the same windows 8 machine with no changes to the setup or configuration at all.



I am recording some tests for our Windows Desktop application. But I am having diffculties when it comes to reliably replaying these tests over and over again.



Our application is made up from a number of different components, but the two I'm having an issue with here is the main MFC application which via COM consumes a .Net assembly which displays a form.



When I recorded the test the .Net form is recorded as:



WinFormsObject("FormBinGridProprties")



However after running the test a couple of times the window can no longer be found.

When viewed within the object viewer the window is identififed as:




Window("WindowsForms10.Window.8.app.0.194e1a4", "Bin Grid Properties", 1)



I can get around this by getting the tests to map the window by using the caption. If I do this it successfully finds the window however I then get problems when trying to access the MainMenu.



What I don't understand at the minute is why the window is sometimes  identififed as a .net control then at other times not.



Please help, as I have so far spent a fair amount of time trying to get this to work.



Cheers

Andy



 

2 Replies

  • andy_cheetham's avatar
    andy_cheetham
    Occasional Contributor
    Thanks for the reply Tanya.



    I have increased this up to 50000 and will see if it makes much difference in the long run.



    The first run of the test scripts I did after making this change failed with the message, couldn't find "Main Menu". Which is what I usually get if the window has not been recongnised as a .Net window.



    With this new time out set it waited for the extended period, but still failed. 



    I would appear to me that it either reconognises the window as a .net control rather quickly or not at all.



    Cheers

    Andy