Skip to main content
added 135 characters in body
Source Link
FDM
  • 5.9k
  • 1
  • 17
  • 34

The error message is just what it says. The element on your page with ID adv-search-mobile has a <div> tag.

You need to update your locator to get the <select> element (within that <div>. A SelectElement object can only be created from a <select>.

If you need more help, you can post your HTML.

EDIT: If the name of your dropdown is unique, you might try:

var salType = driver.FindElement(By.Name("salarytype"));

The error message is just what it says. The element on your page with ID adv-search-mobile has a <div> tag.

You need to update your locator to get the <select> element (within that <div>. A SelectElement object can only be created from a <select>.

If you need more help, you can post your HTML.

The error message is just what it says. The element on your page with ID adv-search-mobile has a <div> tag.

You need to update your locator to get the <select> element (within that <div>. A SelectElement object can only be created from a <select>.

If you need more help, you can post your HTML.

EDIT: If the name of your dropdown is unique, you might try:

var salType = driver.FindElement(By.Name("salarytype"));
Source Link
FDM
  • 5.9k
  • 1
  • 17
  • 34

The error message is just what it says. The element on your page with ID adv-search-mobile has a <div> tag.

You need to update your locator to get the <select> element (within that <div>. A SelectElement object can only be created from a <select>.

If you need more help, you can post your HTML.