Forum Discussion

shanescribner's avatar
shanescribner
New Contributor
3 years ago

TestLeft - Driver.Options.ObjectMapping

I can map controls using logic:

 

Driver.Options.ObjectMapping["Qt Controls"]["List widget"].AddClassName("drop_list");
Driver.Options.ObjectMapping["Qt Controls"]["Combo box"].AddClassName("ZSqlComboBox");
Driver.Options.ObjectMapping["Qt Controls"]["Tree widget"].AddClassName("ZSqlListView");
Driver.Options.ObjectMapping["Qt Controls"]["Line edit"].AddClassName("ZLineEdit");

 

 

Is it possible to query to get a list of Objects that have been mapped?

 

  • Humashankar's avatar
    Humashankar
    Champion Level 3

    Selenium WebDriver doesn't have a built-in way to directly ask for a list of mapped objects.

    If you want to get that list, you'll need to create your own system for keeping track of them. One way is to use a simple list or dictionary to store the mapping information.

    If you need more flexibility in how you get this information, you might want to store it in a database or a special file. Then, you can write functions to find and retrieve the mapped objects based on certain criteria.

    Kindly keep your mapping data updated whenever you add or remove mappings so it stays accurate.

    Hope this helps - Happy to help further!!
    Thank you very much and have a great one!

    Warm regards