Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Select a absent item in select options return success status #282

Closed
xiaospider opened this issue Sep 25, 2018 · 2 comments
Closed

Select a absent item in select options return success status #282

xiaospider opened this issue Sep 25, 2018 · 2 comments
Assignees
Labels
Milestone

Comments

@xiaospider
Copy link

Select a absent item in select drop-down, the command result is success. It's expected to Failed.

Environment
Selenese 3.18.0
Selenium : 3.14.0
Geckodriver: v0.21.0
Firefox: 62.0

My test script is

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head profile="http://selenium-ide.openqa.org/profiles/test-case">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="selenium.base" href="https://www.facebook.com/" />
<title>testSelect</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">testSelect</td></tr>
</thead><tbody>
<tr>
	<td>open</td>
	<td>/</td>
	<td></td>
</tr>
<tr>
	<td>select</td>
	<td>name=birthday_day</td>
	<td>label=35</td>
</tr>

</tbody></table>
</body>
</html>

Selenese log is

16:28:55.931 [main] INFO jp.vmi.selenium.selenese.inject.ExecuteTestCaseInterceptor - baseURL: https://www.facebook.com
16:28:55.947 [main] INFO jp.vmi.selenium.selenese.inject.CommandLogInterceptor - <1> Command#1: open("/")
16:29:11.844 [main] INFO jp.vmi.selenium.selenese.inject.CommandLogInterceptor - - [Success] URL: [https://www.facebook.com/] / Title: [Facebook - Log In or Sign Up]
16:29:11.844 [main] INFO jp.vmi.selenium.selenese.inject.CommandLogInterceptor - - Cookie: _js_reg_fb_ref=[https%3A%2F%2Fwww.facebook.com%2F] (domain=.facebook.com, path=/, expire=*)
16:29:11.844 [main] INFO jp.vmi.selenium.selenese.inject.CommandLogInterceptor - - Cookie: datr=[vfGpW5nfu_sP9625GOIwgXov] (domain=.facebook.com, path=/, expire=2020-09-24 16:28:47 +08:00)
16:29:11.844 [main] INFO jp.vmi.selenium.selenese.inject.CommandLogInterceptor - - Cookie: fr=[1BRXwjs86xTAMZiz8..BbqfG9.lV.AAA.0.0.BbqfG9.AWXpW9Dr] (domain=.facebook.com, path=/, expire=2018-12-24 16:28:45 +08:00)
16:29:11.844 [main] INFO jp.vmi.selenium.selenese.inject.CommandLogInterceptor - - Cookie: reg_fb_gate=[https%3A%2F%2Fwww.facebook.com%2F] (domain=.facebook.com, path=/, expire=*)
16:29:11.844 [main] INFO jp.vmi.selenium.selenese.inject.CommandLogInterceptor - - Cookie: reg_fb_ref=[https%3A%2F%2Fwww.facebook.com%2F] (domain=.facebook.com, path=/, expire=*)
16:29:11.844 [main] INFO jp.vmi.selenium.selenese.inject.CommandLogInterceptor - - Cookie: sb=[vfGpWz42Tl_5EtmTZfjuSsAe] (domain=.facebook.com, path=/, expire=2020-09-24 16:28:45 +08:00)
16:29:11.844 [main] INFO jp.vmi.selenium.selenese.inject.CommandLogInterceptor - - Cookie: wd=[800x452] (domain=.facebook.com, path=/, expire=2018-10-02 16:28:47 +08:00)
16:29:16.572 [main] INFO jp.vmi.selenium.selenese.inject.CommandLogInterceptor - <2> Command#2: select("name=birthday_day", "label=35")
16:31:48.653 [main] INFO jp.vmi.selenium.selenese.inject.CommandLogInterceptor - - [Success]

I test the same case with Java WebDriver , it's worked as expected.

        WebDriver driver = new RemoteWebDriver(seleniumHub, options);
        String baseUrl = "http://www.facebook.com";
        driver.get(baseUrl);
        
        WebElement select = driver.findElement(By.name("birthday_day"));
        Select dropDown = new Select(select);  
        dropDown.selectByValue("35");
        driver.close();

It throw a error

Driver info: driver.version: unknown
	at org.openqa.selenium.support.ui.Select.selectByValue(Select.java:209)
	at com.ibm.perfmgmt.synthetic.SelectTest.main(SelectTest.java:36)
@vmi vmi self-assigned this Sep 27, 2018
@vmi vmi added the bug label Sep 27, 2018
@vmi vmi modified the milestones: 3.20.0, 3.19.0 Sep 27, 2018
@vmi
Copy link
Owner

vmi commented Oct 14, 2018

Hi,

I fixed this problem and released 3.19.0.
Please test it.

@xiaospider
Copy link
Author

@vmi verified , it's fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants