Forum Discussion

MW_Didata's avatar
MW_Didata
Regular Contributor
2 years ago

Alternatives for "SelectedTab [Set]"

We are updating our software to .Net 6, and I noticed some action aren't available anymore.

 

SelectedTab is still availible but doesn't work anymore.

Logs say: Unable to find the object WinFormsObject("tabFinancieel"). See Details for additional information.

However when manually selecting the tab and changing back, using SelectedTab does work.

Almost like the tab doesn't exist if not activated before. when restarting the program it no longer works.

 

I tried 'set_SelectedTab' which also does not work.

I don't want to use 'SelectedIndex [Set]' since the order of the tabs can (and does) change.

 

Is there any other action that might work in the situation?

Or is there any thing my developers can change (small changes only ofcourse) about our code to stop this problem?

 

Thanks!

  • Here to update in case anyone else runs into this issue,

     

    I found a way around this problem. TC didn't see the tabs as object so click would always click on coordinates. Yesterday I was on a call with Smartbear and they showed me the following:

    By putting the parent object in the MSAA list.  Project properties > Open applications > MSAA

    TC is now able to see them as objects, which is great now i can just use a click on them and all is solved.

    Since sometimes some tabs don't exist, I can now use an if object exists ...

     

    This works great for my tests, and might even be a better way to test than before.

     

    Here is the object spy now able to recognise them as objects

     

    Anyways, this issue is now solved. This ticket update is just to help the future people that google this issue in 5 years.

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    "Unable to find the object WinFormsObject("tabFinancieel")" - that implies it's not able to find the object? Does it actually exist and is the name mapping correctly defined for .Net 6.0?

     

    If the tab is already selected, is there any error when calling SelectedTab? Does SelectedIndex work?

     

     

  • MW_Didata's avatar
    MW_Didata
    Regular Contributor

    The object does exist, SelectedIndex does work, but I can't use that in every situation.

    When I manually open the tab it opens just fine, I can then open it as long as that program is open with SelectedTab. But opening the first time I get the Error that it can't be found

     

    I can't automate opening with a click for the same reason I don't want to use SelectedIndex, The Tab order can and does change in certain tests.

     

    Edit: for clarification, it's almost like the tab isn't activated untill i manually open the tab that it stays activated untill I close the program, restarting deactivates it again if that makes sense. 

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    It seems like the control is dynamically created, i.e. TC is not able to see the tabs because it's not created yet.

  • MW_Didata's avatar
    MW_Didata
    Regular Contributor

    Seems like that is indeed the problem, do you know any fixes for this?

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    It's most likely relating to .Net 6 and how controls are rendered. Not sure how to go about fixing this.

     

    Might be worth logging a support call for this.

  • MW_Didata's avatar
    MW_Didata
    Regular Contributor

    We are still in the process of changing the code over, so If there is anyway to change our code that might be possible, It coded in VB.

    I'm sure my developers will be nice enough if it's an easy fix to change a property or something.

     

    Support is aware of the issues we are facing aswell.

  • MW_Didata's avatar
    MW_Didata
    Regular Contributor

    Here to update in case anyone else runs into this issue,

     

    I found a way around this problem. TC didn't see the tabs as object so click would always click on coordinates. Yesterday I was on a call with Smartbear and they showed me the following:

    By putting the parent object in the MSAA list.  Project properties > Open applications > MSAA

    TC is now able to see them as objects, which is great now i can just use a click on them and all is solved.

    Since sometimes some tabs don't exist, I can now use an if object exists ...

     

    This works great for my tests, and might even be a better way to test than before.

     

    Here is the object spy now able to recognise them as objects

     

    Anyways, this issue is now solved. This ticket update is just to help the future people that google this issue in 5 years.