Forum Discussion

MW_Didata's avatar
MW_Didata
Regular Contributor
2 years ago
Solved

SelectedTab [set] not working

Hello,

 

For a Keywordtest TC must open all Tabs and subTabs one by one. I do this by using "SelectedTab [set]" which works great except when it doesn't.

Most of the time it works great, however for some Tabs it can't find the tab and I get an error.

When manually clicking the Tab then going back to another one and running the selected operation suddenly it can find the tab it could not find before.

 

Some Tabs can be found some only after openning once before.

"SelectedIndex [set]" Does work, But if the Tabs were to change order then I would not get the right Tab.

 

 

I don't understand why it can't find the Tab but when the Tab has been opened once it can suddenly find it.

 

 

  • I could not find the solution to this problem,

    I did however sort of find out why this is a problem, the Tabs that don't work are not namemapped untill they have been 'Woken up'.

    My dirty fix was just to use the keys action:

    Aliases.etc.etc.tpAlgemeen.pnlKlantInfo.tabKlantInfo.tabContactpersonen > Keys > [Right]

    this way it can go to every SubTab without using "SelectedTab [set]".

     

    For main Tabs I used:

    Aliases.etc.etc.tpAlgemeen > Keys > [Down]

     

    It's a bad fix but for now it's all I have

     

    Thank you rraghvani  for the help.

11 Replies

  • MW_Didata's avatar
    MW_Didata
    Regular Contributor

    I have also tried using "set_selectedTab" This gave the same issues

    • MW_Didata's avatar
      MW_Didata
      Regular Contributor

      This is what the application looks like, on the left arre main tabs, on the top are subTabs

      as for the properties, I dont know what properties you want to know.

      TabklantInfo is just part of tpAlgemeen (tpAlgemeen is in the left list of Tabs) i need TC to go to tabFinancieel (in the top list of subTabs)

       

      EDIT: For extra information, subTab 'Klantmedewerkers' can be opened by using SelectedTab, Financieel, Prijzen, Verkoop, etc....  Can't be found using this action

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    I wanted to see if there's anything that uniquely identifies the tabs, for example.

    And when switching between tabs, do the properties change

    • MW_Didata's avatar
      MW_Didata
      Regular Contributor

      Things like Name, WndCaption, WinformsControlName.

      There is a Controlid, however i dont know if that stays consistent everytime you open it.

      Once i open the tabFinancieel and then open another one suddenly TC can switch back to tabFinancieel.

      (it will not remember if you then close the whole app)

      TC just says it does not exist if not opened before. while other tabs will open first try

       

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    You click on Omzetten and then click on Financieel? I guess the object is not shown straight away, and hence WinFormObject("tabFinancieel") fails. Try and add a delay.

    • MW_Didata's avatar
      MW_Didata
      Regular Contributor

      I Have tried with delays, using Rclick on SelectedTab_[set] 'Run selected operation' it can't find the tab, I think the object just doesn't exist untill it has been opened once.

       

      TC just posts the same error as 1st pic stated above

  • MW_Didata's avatar
    MW_Didata
    Regular Contributor

    I could not find the solution to this problem,

    I did however sort of find out why this is a problem, the Tabs that don't work are not namemapped untill they have been 'Woken up'.

    My dirty fix was just to use the keys action:

    Aliases.etc.etc.tpAlgemeen.pnlKlantInfo.tabKlantInfo.tabContactpersonen > Keys > [Right]

    this way it can go to every SubTab without using "SelectedTab [set]".

     

    For main Tabs I used:

    Aliases.etc.etc.tpAlgemeen > Keys > [Down]

     

    It's a bad fix but for now it's all I have

     

    Thank you rraghvani  for the help.