c# - How to return multiple data types -


I have a method that I want to be able to return a list of iWebElements, only a list of elements names or Is it possible to return multiple data types with a method of a string array? Is there a more practical way of getting different returns types without using just one method?

  /// & lt; Summary & gt; /// All the options related to this selected tag are available /// & lt; / Summary & gt; /// & lt; Returns & gt; Returns the list of iWebElements & lt; / Returns & gt; Public listing & lt; IWebElement & gt; Get Database of selectAllOptions (IWebDriver Drivers, Ref DataAbject MasterData) {// Dropdown Menu. Database Retrieval GetObjectRepository (referee masterdata); Var strDropMenuId = masterData.DictObjectRepository ["ID"]; Find the // dropdown menu and drag all the options into the list {var dropMenu = new selectElement (driver.FindElement (By.Id (strDropMenuId)); Return drop menu. Option  

return type to

  dictionary & lt; iWebElement, string & gt;  

After compiling the list of iWebElements, you can add a related string to return to the IWebElement with a single dictionary - whatever your method calls, will be both IWebElement and string for processing.

< Pre-> var option = drop menu. Option in the form of list; if (option! = Null) {var value = options.ToDictionary (option => option, option = & gt; the option. Lesson); Return value; }

Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -