Forum Discussion

RajibPradhan's avatar
RajibPradhan
Occasional Contributor
13 years ago

Unable to handle two different windows seperately

Hi,

 In my application I have two different windows like staffPinWindow and staffLaunchWindow. After staffPinWindow,  staffLaunchWindow will come. These two windows have two different window captions.When I am verifying staffLaunchWindow (whether it has come or not), it is showing window is present though realy it is not present.

 What may be the possible reason for this?



Thanks,

Rajib

6 Replies

  • HKosova's avatar
    HKosova
    SmartBear Alumni (Retired)
    Hi Rajib,



    I'm afraid it's not clear from your description what exactly is happening. Could you please post here the script or keyword test you are using, describe the expected and actual behavior, the errors you are getting (if any) and provide other details that seem relevant?



    Just off the top of my head, there may be a problem with identification properties of these windows in your Name Mapping.
  • RajibPradhan's avatar
    RajibPradhan
    Occasional Contributor
    Hi Helen,

     In the attachment I have written one script which will log in the EliteMCP application with proper credentials. Then  I want to verify that login is successful or not. For verification I have used the corresponding APIs. After login, I have done two verifications:

    1. One for wrong password pop up window

    2. Second for next window which should come after successful login(i.e staffLaunchWindow).



     But unfortunately, When I am verifying with wrong password, the first verification is correct i.e. a pop up window is coming giving message that password is incorrect. But the second verification is incorrect. It is telling that  staffLaunchWindow is coming Which is not true.



     Please provide the reason and solution for it.



    Thanks,

    Rajib
  • RajibPradhan's avatar
    RajibPradhan
    Occasional Contributor




    Hi,

     In the attachment I have written one script which will log in the
    EliteMCP application with proper credentials. Then  I want to verify
    that login is successful or not. For verification I have used the
    corresponding APIs. After login, I have done two verifications:

    1. One for wrong password pop up window

    2. Second for next window which should come after successful login(i.e staffLaunchWindow).



     But unfortunately, When I am verifying with wrong password, the first
    verification is correct i.e. a pop up window is coming giving message
    that password is incorrect. But the second verification is incorrect. It
    is telling that  staffLaunchWindow is coming Which is not true.



     
    Will you please provide me the reason and solution for it.



    Thanks,

    Rajib



  • HKosova's avatar
    HKosova
    SmartBear Alumni (Retired)
    Hi Rajib,



    The script seems to be correct. Without further seeing the test logs, test project and your application under test, my guess is that it's the Name Mapping issue.



    Try inserting the RefreshMappingInfo method call before verifying the StaffLaunchWnd object and see if this helps:

    Aliases.EliteMCP.wndEliteMCP.StaffLaunchWnd.RefreshMappingInfo

    'Verify the staff launch window

    Set obj = Aliases.EliteMCP.wndEliteMCP.StaffLaunchWnd

    ...


    If the issue also occurs when using RefreshMappingInfo, it's probably caused by non-unique identification properties of the StaffLaunchWnd object in Name Mapping that result in matching another object. In this case, you need to modify the Name Mapping criteria (for example, add other properties) to make them unique for this object.





    By the way, you can shorten the script for entering the staffId and password values if you dynamically evaluate the appropriate button names instead of using the Select Case statement:

    For cnt = 1 To Len(staffId)

      x = Mid(staffId, cnt, 1)

      Execute "staffPinWnd.btn" & x & ".ClickButton"

    Next

    ...

    For cnt = 1 To Len(password)

      x = Mid(password, cnt, 1)

      Execute "staffPinWnd.btn" & x & ".ClickButton"

    Next
  • RajibPradhan's avatar
    RajibPradhan
    Occasional Contributor
    Hi Helen,

     Thanks for the idea about shortening the login script.

    To solve my problem I applied the two ways, but no result.

     Is there any other way of solving it?



    Thanks,

    Rajib
  • HKosova's avatar
    HKosova
    SmartBear Alumni (Retired)
    Hi Rajib,



    It looks like we'll need to take a closer look at your test project, Name Mapping and test logs to understand what exactly is going wrong. So I would like to ask you to open a support ticket and send our Support Team your test project along with test logs. This will help troubleshoot the issue more efficiently.