Sometimes it works, and sometimes not.
Code: Select all
public void SwitchLanguage(string language)
{
// click on dropdown to open list from which to chose items
languageSwitchComboBox.Click();
// search for item in list by text
for (int i = 0; i < languageSwitchComboBox.Items.Count; i++)
if (language.Equals(languageSwitchComboBox.Items[i].Text))
// when its found click on that item
languageSwitchComboBox.Items[i].Click();
}
I have run it few times and sometimes it didn't work...
Regards,
Vajda Vladimir