Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.4.4

Bug #9189 Select-Option containing enties not selectable
Submitted: 2006-10-28 16:09 UTC
From: nohn Assigned: shin
Status: Assigned Package: Testing_Selenium (version 0.2.1)
PHP Version: Irrelevant OS: Irrelevant
Roadmaps: (Not assigned)    
Subscription  


 [2006-10-28 16:09 UTC] nohn (Sebastian Nohn)
Description: ------------ <select id="parent_cat" name="serendipity[cat][parent_cat]"> <option value="0" selected="selected">[ No Category ]</option> <option value="1">Test Category 001</option> <option value="3">b</option> <option value="2">Test Category 002</option> </select> Selection the option labelled " Test Category 001-1" is not possible: select('parent_cat', ' Test Category 001-1'); (of course) does not find´the element, but select('parent_cat', ' Test Category 001-1'); doesn't work either. Output on Selnium RC console is: queryString = cmd=select&1=parent_cat&2=&nbsp;Test Category 001-1&sessionId=1162051371798 Got result: ERROR: Option with label '' not found So I guess it's an encoding issue. Test script: --------------- <select id="parent_cat" name="serendipity[cat][parent_cat]"> <option value="0" selected="selected">[ No Category ]</option> <option value="1">Test Category 001</option> <option value="3">b</option> <option value="2">Test Category 002</option> </select> select('parent_cat', ' Test Category 001-1'); Expected result: ---------------- queryString = cmd=select&1=parent_cat&2= Test Category 001-1&sessionId=1162051371798 Got result: OK Actual result: -------------- queryString = cmd=select&1=parent_cat&2=&nbsp;Test Category 001-1&sessionId=1162051371798 Got result: ERROR: Option with label '' not found

Comments

 [2006-10-30 00:25 UTC] shin (Shin Ohno)
Thank you for the bug report. Let me check if I understand this problem. In the sample HTML: -- <option value="1">Test Category 001</option> -- I found that there is no space between '1">' and 'Test Ca'. I think sample HTML would be: -- <option value="1"> Test Category 001</option> -- or <option value="1"> Test Category 001</option> -- Well, both did not work anyway, and it looks like encoding problem as you mentioned, I will investigate and try to fix it. And let me check the your command "select", in the bug report, you are using: -- select('parent_cat', ' Test Category 001-1'); -- but, the last two letters "-1" are not in the sample HTML's option label. I wonder these "-1" are some kind of typo?
 [2006-10-30 07:28 UTC] nohn at php dot net (Sebastian Nohn)
Correct, this is what I meant.
 [2006-11-03 17:16 UTC] shin (Shin Ohno)
Thank you for your bug report. This issue has been fixed in the latest released version of the package, which you can download at http://pear.php.net/get/Testing_Selenium I fixed this bug in 0.2.1.
 [2006-11-03 17:52 UTC] nohn at php dot net (Sebastian Nohn)
Can't confirm the fix. The Test Code is: ================= $this->assertTextPresent(CREATE_NEW_CAT); $this->select('parent_cat', ' Test Category 001-1'); $this->type('serendipity[cat][name]', 'Test Category 001-1-1'); $this->type('serendipity[cat][description]', 'This is the description for Test Category 001-1-1'); $this->clickAndWait('SAVE'); The HTML is: ============ <select id="parent_cat" name="serendipity[cat][parent_cat]"> <option value="0" selected="selected">[ No Category ]</option> <option value="1">Test Category 001</option> <option value="3"> Test Category 001-1</option> <option value="2">Test Category 002</option> </select> The Error is: ============= 1) testCreateContentCategory(SerendipityTestSuite) Testing_Selenium_Exception: The Response of the Selenium RC is invalid: ERROR: Option with label ' Test Category 001-1' not found /home/sebastian/Work/s9y/tests/gui/SerendipityTestSuite.php:140 /opt/php/bin/phpunit:40
 [2006-11-04 01:57 UTC] shin (Shin Ohno)
Thank you for the bug report. I see. The one with   does not work. I will work on this from now. The fix I put in 0.2.1 was that whitespace between start and end text is trimed. That mean, <option value="1"> Test Category 001</option> and <option value="1">Test Category 001</option> are same. Selenium RC Server trims whitespace. Also -- $selenium->select('parent_cat', 'Test Category 001'); and $selenium->select('parent_cat', ' Test Category 001'); are same. But this bug report pointed out   problem. This has to be fixed, and I will work on it. Thanks