History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: SRC-484
Type: Improvement Improvement
Status: Open Open
Priority: Minor Minor
Assignee: Unassigned
Reporter: Vince Spicer
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Selenium Remote Control

selenium.get_number returns a string

Created: 09/Jun/08 01:22 PM   Updated: 12/Aug/08 05:35 PM
Component/s: Client Driver - Python
Affects Version/s: 0.9.2
Fix Version/s: None

Original Estimate: 0.17h Remaining Estimate: 0.17h Time Spent: Unknown
File Attachments: 1. File selenium.diff (1 kb)



 Description  « Hide
in the Selenium Driver the get_number function returns a string instead of an integer.
Also the selenium.get_selected_index(select) returned a string aswell.

This was complicating things when trying to select the next value in a select box.

Simple patch below

Index: /selenium.py
===================================================================
--- /selenium.py (revision XXXX)
+++ /selenium.py (working copy)
@@ -228,8 +228,10 @@
         return tokens
 
     def get_number(self, verb, args):
- # Is there something I need to do here?
- return self.get_string(verb, args)
+ try:
+ return int(self.get_string(verb, args))
+ except TypeError:
+ return None
     
     def get_number_array(self, verb, args):
         # Is there something I need to do here?
@@ -1175,7 +1177,7 @@
         
         'selectLocator' is an element locator identifying a drop-down menu
         """
- return self.get_string("getSelectedIndex", [selectLocator,])
+ return self.get_number("getSelectedIndex", [selectLocator,])
 
 
     def get_selected_ids(self,selectLocator):


 All   Comments   Work Log   Change History      Sort Order:
Vince Spicer - 09/Jun/08 01:33 PM
Updated path to also patch the get_numbers_array function

Vince Spicer - 11/Jun/08 10:57 PM
After looking around at the build process I see it is iedoc.xml that needs to be updated so getSelectedIndex, and getSelectedIndexes have a return type="number"