Verifying Dropdown options my script is throwing an error pls help Webdriver and C# -


verifying dropdown options script throwing error pls webdriver , c#

two errors returned ; expected on options ( for(iwebelement title:options))

public void verifydropdownoptions() {   string[] sysviews = {   "--select view--",   "contacts being followed",   "contact follow",   "contacts: no campaign activities in last 3 months",   "contacts: responded campaigns in last 6 months",   "inactive contacts","my connections" };  iwebelement dropdown = findelement(by.id("crmgrid_savednewqueryselector"));         selectelement select = new selectelement(dropdown);         list<iwebelement> options = select.getoptions();       // list<iwebelement> options = select.findelements(by.linktext("title"));         int sysoptions = sysviews.length;    for(iwebelement title:options)         {         boolean match = false;           (int i=0; < sysoptions; i++)            {               if (title.gettext().equals(sysviews[i]))                 {                 match = true;                 }           }        assert.true(match);      }       } 

you using c# use below code foreach loop:

foreach (iwebelement title in options) {   } 

: use java not c#


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -