Discussion:
[selenium-users] The constructor Select(WebElement) is undefined
Devarajan S
2016-07-21 14:42:17 UTC
Permalink
Hi, I have started learning Selenium recently. When I was trying to work
with drop-down list, I faced an issue like "The constructor
Select(WebElement) is undefined". Using Selenium-standalone-server-2.53.1
It is a very simple and straightforward program as below:

package Lab1;

import org.openqa.jetty.html.Select;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;

public class Forms {

public static void main(String[] args) {
// TODO Auto-generated method stub
WebDriver d = new FirefoxDriver();
d.manage().window().maximize();
d.get("https://www.formsite.com/example/conference-signup-form/");
WebElement element = d.findElement(By.id("RESULT_RadioButton-17"));
Select s = new Select(element);
d.close();
}
}

Could any one please help me to proceed further?

Thanks,
Devarajan
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+***@googlegroups.com.
To post to this group, send email to selenium-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/72e439d3-c18c-4fd8-8339-aebfed8a2f36%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
k***@gmail.com
2016-07-22 06:48:34 UTC
Permalink
Hi ,

import org.openqa.jetty.html.Select;

remove that line and import select class from

selenium.ui...etc.
Post by Devarajan S
Hi, I have started learning Selenium recently. When I was trying to work
with drop-down list, I faced an issue like "The constructor
Select(WebElement) is undefined". Using Selenium-standalone-server-2.53.1
package Lab1;
import org.openqa.jetty.html.Select;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
public class Forms {
public static void main(String[] args) {
// TODO Auto-generated method stub
WebDriver d = new FirefoxDriver();
d.manage().window().maximize();
d.get("https://www.formsite.com/example/conference-signup-form/");
WebElement element = d.findElement(By.id("RESULT_RadioButton-17"));
Select s = new Select(element);
d.close();
}
}
Could any one please help me to proceed further?
Thanks,
Devarajan
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+***@googlegroups.com.
To post to this group, send email to selenium-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/dbacd43a-4fe8-4814-9b53-3ef360dfb621%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Aniket Mane
2016-07-22 05:59:56 UTC
Permalink
Use findElements instead of findElement.
Post by Devarajan S
Hi, I have started learning Selenium recently. When I was trying to work
with drop-down list, I faced an issue like "The constructor
Select(WebElement) is undefined". Using Selenium-standalone-server-2.53.1
package Lab1;
import org.openqa.jetty.html.Select;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
public class Forms {
public static void main(String[] args) {
// TODO Auto-generated method stub
WebDriver d = new FirefoxDriver();
d.manage().window().maximize();
d.get("https://www.formsite.com/example/conference-signup-form/");
WebElement element = d.findElement(By.id("RESULT_RadioButton-17"));
Select s = new Select(element);
d.close();
}
}
Could any one please help me to proceed further?
Thanks,
Devarajan
--
You received this message because you are subscribed to the Google Groups
"Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an
To view this discussion on the web visit
https://groups.google.com/d/msgid/selenium-users/72e439d3-c18c-4fd8-8339-aebfed8a2f36%40googlegroups.com
<https://groups.google.com/d/msgid/selenium-users/72e439d3-c18c-4fd8-8339-aebfed8a2f36%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+***@googlegroups.com.
To post to this group, send email to selenium-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAJ5sn7Rs_7rUowyBGWi96nGH%3DqAVExawogqtbfowrAGLroSOtw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Nagarjuna Madineni
2016-07-25 11:52:11 UTC
Permalink
use import org.openqa.selenium.support.ui.Select;

instead of import org.openqa.jetty.html.Select;
Post by Devarajan S
Hi, I have started learning Selenium recently. When I was trying to work
with drop-down list, I faced an issue like "The constructor
Select(WebElement) is undefined". Using Selenium-standalone-server-2.53.1
package Lab1;
import org.openqa.jetty.html.Select;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
public class Forms {
public static void main(String[] args) {
// TODO Auto-generated method stub
WebDriver d = new FirefoxDriver();
d.manage().window().maximize();
d.get("https://www.formsite.com/example/conference-signup-form/");
WebElement element = d.findElement(By.id("RESULT_RadioButton-17"));
Select s = new Select(element);
d.close();
}
}
Could any one please help me to proceed further?
Thanks,
Devarajan
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+***@googlegroups.com.
To post to this group, send email to selenium-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/ddb41c38-93e0-4fab-a51e-6b0eafb4085a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
shruthi v v
2016-07-25 11:59:52 UTC
Permalink
This line should solve your problem as Nagarjuna said.

import org.openqa.selenium.support.ui.Select;














Shruthi

On Mon, Jul 25, 2016 at 5:22 PM, Nagarjuna Madineni <
Post by Nagarjuna Madineni
use import org.openqa.selenium.support.ui.Select;
instead of import org.openqa.jetty.html.Select;
Post by Devarajan S
Hi, I have started learning Selenium recently. When I was trying to work
with drop-down list, I faced an issue like "The constructor
Select(WebElement) is undefined". Using Selenium-standalone-server-2.53.1
package Lab1;
import org.openqa.jetty.html.Select;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
public class Forms {
public static void main(String[] args) {
// TODO Auto-generated method stub
WebDriver d = new FirefoxDriver();
d.manage().window().maximize();
d.get("https://www.formsite.com/example/conference-signup-form/
");
WebElement element =
d.findElement(By.id("RESULT_RadioButton-17"));
Select s = new Select(element);
d.close();
}
}
Could any one please help me to proceed further?
Thanks,
Devarajan
--
You received this message because you are subscribed to the Google Groups
"Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an
To view this discussion on the web visit
https://groups.google.com/d/msgid/selenium-users/ddb41c38-93e0-4fab-a51e-6b0eafb4085a%40googlegroups.com
<https://groups.google.com/d/msgid/selenium-users/ddb41c38-93e0-4fab-a51e-6b0eafb4085a%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+***@googlegroups.com.
To post to this group, send email to selenium-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAERCCePjmDM0RJdyf0ZK-B63A_C%3DrG0RSU7XL3qK3TEkR9_6Jw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Meghasri K
2018-12-06 05:59:08 UTC
Permalink
I faced the similar issue. But then i have a method for Alert box. When i
am using the wait i got the similar issue

if (sActionName.equalsIgnoreCase("acceptAlert")) {
WebDriverWait wait = new WebDriverWait(oDriver, 2);
wait.until(ExpectedConditions.alertIsPresent());
oDriver.getDriver().switchTo().alert().accept();
return "";
}
Kindly help me in resolving the issue
Post by shruthi v v
This line should solve your problem as Nagarjuna said.
import org.openqa.selenium.support.ui.Select;
Shruthi
On Mon, Jul 25, 2016 at 5:22 PM, Nagarjuna Madineni <
Post by Nagarjuna Madineni
use import org.openqa.selenium.support.ui.Select;
instead of import org.openqa.jetty.html.Select;
Post by Devarajan S
Hi, I have started learning Selenium recently. When I was trying to work
with drop-down list, I faced an issue like "The constructor
Select(WebElement) is undefined". Using Selenium-standalone-server-2.53.1
package Lab1;
import org.openqa.jetty.html.Select;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
public class Forms {
public static void main(String[] args) {
// TODO Auto-generated method stub
WebDriver d = new FirefoxDriver();
d.manage().window().maximize();
d.get("https://www.formsite.com/example/conference-signup-form/
");
WebElement element =
d.findElement(By.id("RESULT_RadioButton-17"));
Select s = new Select(element);
d.close();
}
}
Could any one please help me to proceed further?
Thanks,
Devarajan
--
You received this message because you are subscribed to the Google Groups
"Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an
<javascript:>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/selenium-users/ddb41c38-93e0-4fab-a51e-6b0eafb4085a%40googlegroups.com
<https://groups.google.com/d/msgid/selenium-users/ddb41c38-93e0-4fab-a51e-6b0eafb4085a%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+***@googlegroups.com.
To post to this group, send email to selenium-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/3c74b71a-4ca9-4632-963b-20492903a70f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...