Updated command_executor

Added more examples.
This commit is contained in:
jvelilla
2013-05-22 07:18:17 -03:00
parent a6cad7e811
commit 7dbed3ade1
4 changed files with 224 additions and 156 deletions

View File

@@ -50,6 +50,12 @@
<root class="FIND_ELEMENT_CSS_SELECTOR" feature="default_create"/> <root class="FIND_ELEMENT_CSS_SELECTOR" feature="default_create"/>
<cluster name="src" location=".\" recursive="true"/> <cluster name="src" location=".\" recursive="true"/>
</target> </target>
<target name="findElementXPath" extends="selenium_example">
<root class="FIND_ELEMENT_XPATH" feature="default_create"/>
<cluster name="src" location=".\" recursive="true"/>
</target>

View File

@@ -46,6 +46,16 @@ feature -- Search by id
if attached web_driver.get_page_tile as l_title then if attached web_driver.get_page_tile as l_title then
print ("%NPage title is:" + l_title) print ("%NPage title is:" + l_title)
end end
-- Find the user name, password element by its id and submit
if attached {WEB_ELEMENT} web_driver.find_element ((create {SE_BY}).id ("edit-name")) as l_user and then attached {WEB_ELEMENT} web_driver.find_element ((create {SE_BY}).id ("edit-pass")) as l_pass and then attached {WEB_ELEMENT} web_driver.find_element ((create {SE_BY}).id ("edit-submit")) as l_form then
if attached l_user.get_css_value ("width") as l_width then
print ("%NCss value:" + l_width)
end
end
io.read_line
-- close the window -- close the window
web_driver.window_close web_driver.window_close
end end

View File

@@ -0,0 +1,74 @@
note
description: "[
]"
class
FIND_ELEMENT_XPATH
inherit
ANY
redefine
default_create
end
create
default_create
feature
default_create
do
search
end
feature -- Search by id
search
local
web_driver: WEB_DRIVER
xpath_expression : STRING_32
do
--Create a new instance of a Web driver
create web_driver.make
-- Start session with chrome
web_driver.start_session_chrome
-- Go to EiffelRoom home page
web_driver.to_url ("http://www.eiffelroom.com/")
--Xpath expression
xpath_expression := "//*[@id='page']"
if attached {WEB_ELEMENT} web_driver.find_element ((create {SE_BY}).xpath (xpath_expression)) as l_path then
print ("%NElement:" + l_path.element)
end
-- Images with Alt
-- img[@alt]
if attached {LIST[WEB_ELEMENT]}web_driver.find_elements ((create {SE_BY}).xpath ("//img[@alt]")) as l_paths then
from
l_paths.start
until
l_paths.after
loop
print ("%NElement:" + l_paths.item.element)
l_paths.forth
end
end
print ("%Nend process ...")
io.read_line
-- close the window
web_driver.window_close
end
expected_title (driver: WEB_DRIVER; title: STRING_32): BOOLEAN
do
if attached {STRING_32} driver.get_page_tile as l_title and then l_title.has_substring (title) then
Result := True
end
end
end

View File

@@ -14,9 +14,10 @@ inherit
SE_JSON_WIRE_PROTOCOL_COMMANDS SE_JSON_WIRE_PROTOCOL_COMMANDS
-- TODO -- TODO
-- clean and improve the code -- clean and improve the code
-- handle response from the server in a smart way -- handle response from the server in a smart way
create create
make make
@@ -29,7 +30,7 @@ feature -- Initialization
host := a_host host := a_host
create h.make create h.make
http_session := h.new_session (a_host) http_session := h.new_session (a_host)
http_session.set_timeout (5) -- http_session.set_timeout (5)
-- http_session.set_is_debug (True) -- http_session.set_is_debug (True)
-- http_session.set_proxy ("127.0.0.1", 8888) -- http_session.set_proxy ("127.0.0.1", 8888)
end end
@@ -95,7 +96,7 @@ feature -- Commands
local local
resp: HTTP_CLIENT_RESPONSE resp: HTTP_CLIENT_RESPONSE
do do
resp := execute_delete (cmd_session_by_id ( session_id )) resp := execute_delete (cmd_session_by_id (session_id))
Result := new_response (session_id, resp) Result := new_response (session_id, resp)
end end
@@ -199,7 +200,7 @@ feature -- Commands
Result := new_response (a_session_id, resp) Result := new_response (a_session_id, resp)
end end
execute (a_session_id : STRING_32; data : STRING_32) : SE_RESPONSE execute (a_session_id: STRING_32; data: STRING_32): SE_RESPONSE
require require
selinum_server_available: is_available selinum_server_available: is_available
local local
@@ -209,13 +210,13 @@ feature -- Commands
Result := new_response (a_session_id, resp) Result := new_response (a_session_id, resp)
end end
execute_async (a_session_id : STRING_32; data : STRING_32) : SE_RESPONSE execute_async (a_session_id: STRING_32; data: STRING_32): SE_RESPONSE
require require
selinum_server_available: is_available selinum_server_available: is_available
local local
resp: HTTP_CLIENT_RESPONSE resp: HTTP_CLIENT_RESPONSE
do do
resp := execute_post (cmd_session_execute_async (a_session_id),data) resp := execute_post (cmd_session_execute_async (a_session_id), data)
Result := new_response (a_session_id, resp) Result := new_response (a_session_id, resp)
end end
@@ -279,7 +280,6 @@ feature -- Commands
Result := new_response (a_session_id, resp) Result := new_response (a_session_id, resp)
end end
frame (a_session_id: STRING_32; a_data: STRING_32): SE_RESPONSE frame (a_session_id: STRING_32; a_data: STRING_32): SE_RESPONSE
require require
selinum_server_available: is_available selinum_server_available: is_available
@@ -300,7 +300,6 @@ feature -- Commands
Result := new_response (a_session_id, resp) Result := new_response (a_session_id, resp)
end end
close_window (a_session_id: STRING_32): SE_RESPONSE close_window (a_session_id: STRING_32): SE_RESPONSE
require require
selinum_server_available: is_available selinum_server_available: is_available
@@ -311,58 +310,57 @@ feature -- Commands
Result := new_response (a_session_id, resp) Result := new_response (a_session_id, resp)
end end
change_size_window (a_session_id: STRING_32; a_window_handle : STRING_32;a_data: STRING_32): SE_RESPONSE change_size_window (a_session_id: STRING_32; a_window_handle: STRING_32; a_data: STRING_32): SE_RESPONSE
require require
selinum_server_available: is_available selinum_server_available: is_available
local local
resp: HTTP_CLIENT_RESPONSE resp: HTTP_CLIENT_RESPONSE
do do
resp := execute_post (cmd_session_window_size (a_session_id,a_window_handle), a_data) resp := execute_post (cmd_session_window_size (a_session_id, a_window_handle), a_data)
Result := new_response (a_session_id, resp) Result := new_response (a_session_id, resp)
end end
size_window (a_session_id: STRING_32; a_window_handle : STRING_32) : SE_RESPONSE size_window (a_session_id: STRING_32; a_window_handle: STRING_32): SE_RESPONSE
require require
selinum_server_available: is_available selinum_server_available: is_available
local local
resp: HTTP_CLIENT_RESPONSE resp: HTTP_CLIENT_RESPONSE
do do
resp := execute_get (cmd_session_window_size (a_session_id,a_window_handle)) resp := execute_get (cmd_session_window_size (a_session_id, a_window_handle))
Result := new_response (a_session_id, resp) Result := new_response (a_session_id, resp)
end end
change_window_position (a_session_id: STRING_32; a_window_handle : STRING_32;a_data: STRING_32): SE_RESPONSE change_window_position (a_session_id: STRING_32; a_window_handle: STRING_32; a_data: STRING_32): SE_RESPONSE
require require
selinum_server_available: is_available selinum_server_available: is_available
local local
resp: HTTP_CLIENT_RESPONSE resp: HTTP_CLIENT_RESPONSE
do do
resp := execute_post (cmd_session_window_position (a_session_id,a_window_handle), a_data) resp := execute_post (cmd_session_window_position (a_session_id, a_window_handle), a_data)
Result := new_response (a_session_id, resp) Result := new_response (a_session_id, resp)
end end
window_position (a_session_id: STRING_32; a_window_handle : STRING_32) : SE_RESPONSE window_position (a_session_id: STRING_32; a_window_handle: STRING_32): SE_RESPONSE
require require
selinum_server_available: is_available selinum_server_available: is_available
local local
resp: HTTP_CLIENT_RESPONSE resp: HTTP_CLIENT_RESPONSE
do do
resp := execute_get (cmd_session_window_size (a_session_id,a_window_handle)) resp := execute_get (cmd_session_window_size (a_session_id, a_window_handle))
Result := new_response (a_session_id, resp) Result := new_response (a_session_id, resp)
end end
window_maximize (a_session_id: STRING_32; a_window_handle : STRING_32) : SE_RESPONSE window_maximize (a_session_id: STRING_32; a_window_handle: STRING_32): SE_RESPONSE
require require
selinum_server_available: is_available selinum_server_available: is_available
local local
resp: HTTP_CLIENT_RESPONSE resp: HTTP_CLIENT_RESPONSE
do do
resp := execute_post (cmd_session_window_maximize (a_session_id,a_window_handle), Void) resp := execute_post (cmd_session_window_maximize (a_session_id, a_window_handle), Void)
Result := new_response (a_session_id, resp) Result := new_response (a_session_id, resp)
end end
retrieve_cookies (a_session_id: STRING_32): SE_RESPONSE
retrieve_cookies (a_session_id: STRING_32) : SE_RESPONSE
require require
selinum_server_available: is_available selinum_server_available: is_available
local local
@@ -372,17 +370,17 @@ feature -- Commands
Result := new_response (a_session_id, resp) Result := new_response (a_session_id, resp)
end end
set_cookie (a_session_id: STRING_32; a_data : STRING_32) : SE_RESPONSE set_cookie (a_session_id: STRING_32; a_data: STRING_32): SE_RESPONSE
require require
selinum_server_available: is_available selinum_server_available: is_available
local local
resp: HTTP_CLIENT_RESPONSE resp: HTTP_CLIENT_RESPONSE
do do
resp := execute_post (cmd_session_cookie (a_session_id),a_data) resp := execute_post (cmd_session_cookie (a_session_id), a_data)
Result := new_response (a_session_id, resp) Result := new_response (a_session_id, resp)
end end
delete_cookies (a_session_id: STRING_32) : SE_RESPONSE delete_cookies (a_session_id: STRING_32): SE_RESPONSE
require require
selinum_server_available: is_available selinum_server_available: is_available
local local
@@ -392,17 +390,17 @@ feature -- Commands
Result := new_response (a_session_id, resp) Result := new_response (a_session_id, resp)
end end
delete_cookie_by_name (a_session_id: STRING_32; a_name : STRING_32) : SE_RESPONSE delete_cookie_by_name (a_session_id: STRING_32; a_name: STRING_32): SE_RESPONSE
require require
selinum_server_available: is_available selinum_server_available: is_available
local local
resp: HTTP_CLIENT_RESPONSE resp: HTTP_CLIENT_RESPONSE
do do
resp := execute_delete (cmd_session_cookie_delete (a_session_id,a_name)) resp := execute_delete (cmd_session_cookie_delete (a_session_id, a_name))
Result := new_response (a_session_id, resp) Result := new_response (a_session_id, resp)
end end
page_source (a_session_id: STRING_32) : SE_RESPONSE page_source (a_session_id: STRING_32): SE_RESPONSE
require require
selinum_server_available: is_available selinum_server_available: is_available
local local
@@ -412,8 +410,7 @@ feature -- Commands
Result := new_response (a_session_id, resp) Result := new_response (a_session_id, resp)
end end
page_title (a_session_id: STRING_32): SE_RESPONSE
page_title (a_session_id: STRING_32) : SE_RESPONSE
require require
selinum_server_available: is_available selinum_server_available: is_available
local local
@@ -423,42 +420,37 @@ feature -- Commands
Result := new_response (a_session_id, resp) Result := new_response (a_session_id, resp)
end end
search_element (a_session_id: STRING_32; a_data: STRING_32): SE_RESPONSE
search_element (a_session_id: STRING_32; a_data :STRING_32) : SE_RESPONSE
require require
selinum_server_available: is_available selinum_server_available: is_available
local local
resp: HTTP_CLIENT_RESPONSE resp: HTTP_CLIENT_RESPONSE
do do
resp := execute_post (cmd_session_element (a_session_id),a_data) resp := execute_post (cmd_session_element (a_session_id), a_data)
Result := new_response (a_session_id, resp) Result := new_response (a_session_id, resp)
end end
search_element_id_element (a_session_id: STRING_32; id: STRING_32; a_data: STRING_32): SE_RESPONSE
search_element_id_element (a_session_id: STRING_32; id : STRING_32; a_data :STRING_32) : SE_RESPONSE
require require
selinum_server_available: is_available selinum_server_available: is_available
local local
resp: HTTP_CLIENT_RESPONSE resp: HTTP_CLIENT_RESPONSE
do do
resp := execute_post (cmd_session_element_id_element (a_session_id,id),a_data) resp := execute_post (cmd_session_element_id_element (a_session_id, id), a_data)
Result := new_response (a_session_id, resp) Result := new_response (a_session_id, resp)
end end
search_elements (a_session_id: STRING_32; a_data: STRING_32): SE_RESPONSE
search_elements (a_session_id: STRING_32; a_data :STRING_32) : SE_RESPONSE
require require
selinum_server_available: is_available selinum_server_available: is_available
local local
resp: HTTP_CLIENT_RESPONSE resp: HTTP_CLIENT_RESPONSE
do do
resp := execute_post (cmd_session_elements (a_session_id),a_data) resp := execute_post (cmd_session_elements (a_session_id), a_data)
Result := new_response (a_session_id, resp) Result := new_response (a_session_id, resp)
end end
element_active (a_session_id: STRING_32): SE_RESPONSE
element_active (a_session_id: STRING_32) : SE_RESPONSE
require require
selinum_server_available: is_available selinum_server_available: is_available
local local
@@ -468,184 +460,177 @@ feature -- Commands
Result := new_response (a_session_id, resp) Result := new_response (a_session_id, resp)
end end
search_element_id_elements (a_session_id: STRING_32; id: STRING_32; a_data: STRING_32): SE_RESPONSE
search_element_id_elements (a_session_id: STRING_32; id : STRING_32; a_data :STRING_32) : SE_RESPONSE
require require
selinum_server_available: is_available selinum_server_available: is_available
local local
resp: HTTP_CLIENT_RESPONSE resp: HTTP_CLIENT_RESPONSE
do do
resp := execute_post (cmd_session_element_id_elements (a_session_id,id),a_data) resp := execute_post (cmd_session_element_id_elements (a_session_id, id), a_data)
Result := new_response (a_session_id, resp) Result := new_response (a_session_id, resp)
end end
element_click (a_session_id: STRING_32; id : STRING_32) : SE_RESPONSE element_click (a_session_id: STRING_32; id: STRING_32): SE_RESPONSE
require require
selinum_server_available: is_available selinum_server_available: is_available
local local
resp: HTTP_CLIENT_RESPONSE resp: HTTP_CLIENT_RESPONSE
do do
resp := execute_post (cmd_session_element_click (a_session_id,id),Void) resp := execute_post (cmd_session_element_click (a_session_id, id), Void)
Result := new_response (a_session_id, resp) Result := new_response (a_session_id, resp)
end end
element_submit (a_session_id: STRING_32; id: STRING_32): SE_RESPONSE
element_submit (a_session_id: STRING_32; id : STRING_32) : SE_RESPONSE
require require
selinum_server_available: is_available selinum_server_available: is_available
local local
resp: HTTP_CLIENT_RESPONSE resp: HTTP_CLIENT_RESPONSE
do do
resp := execute_post (cmd_session_element_submit (a_session_id,id),Void) resp := execute_post (cmd_session_element_submit (a_session_id, id), Void)
Result := new_response (a_session_id, resp) Result := new_response (a_session_id, resp)
end end
element_text (a_session_id: STRING_32; id: STRING_32): SE_RESPONSE
element_text (a_session_id: STRING_32; id : STRING_32) : SE_RESPONSE
require require
selinum_server_available: is_available selinum_server_available: is_available
local local
resp: HTTP_CLIENT_RESPONSE resp: HTTP_CLIENT_RESPONSE
do do
resp := execute_get (cmd_session_element_text (a_session_id,id)) resp := execute_get (cmd_session_element_text (a_session_id, id))
Result := new_response (a_session_id, resp) Result := new_response (a_session_id, resp)
end end
send_events (a_session_id: STRING_32; id : STRING_32; data : STRING_32) : SE_RESPONSE send_events (a_session_id: STRING_32; id: STRING_32; data: STRING_32): SE_RESPONSE
require require
selinum_server_available: is_available selinum_server_available: is_available
local local
resp: HTTP_CLIENT_RESPONSE resp: HTTP_CLIENT_RESPONSE
do do
resp := execute_post (cmd_session_element_event (a_session_id,id),data) resp := execute_post (cmd_session_element_event (a_session_id, id), data)
Result := new_response (a_session_id, resp) Result := new_response (a_session_id, resp)
end end
send_key_strokes (a_session_id: STRING_32; data: STRING_32): SE_RESPONSE
send_key_strokes (a_session_id: STRING_32; data : STRING_32) : SE_RESPONSE
require require
selinum_server_available: is_available selinum_server_available: is_available
local local
resp: HTTP_CLIENT_RESPONSE resp: HTTP_CLIENT_RESPONSE
do do
resp := execute_post (cmd_session_keys (a_session_id),data) resp := execute_post (cmd_session_keys (a_session_id), data)
Result := new_response (a_session_id, resp) Result := new_response (a_session_id, resp)
end end
query_by_tag_name (a_session_id: STRING_32; id : STRING_32) : SE_RESPONSE query_by_tag_name (a_session_id: STRING_32; id: STRING_32): SE_RESPONSE
require require
selinum_server_available: is_available selinum_server_available: is_available
local local
resp: HTTP_CLIENT_RESPONSE resp: HTTP_CLIENT_RESPONSE
do do
resp := execute_get (cmd_session_element_name (a_session_id,id)) resp := execute_get (cmd_session_element_name (a_session_id, id))
Result := new_response (a_session_id, resp) Result := new_response (a_session_id, resp)
end end
clear_element (a_session_id: STRING_32; id: STRING_32): SE_RESPONSE
clear_element (a_session_id: STRING_32; id : STRING_32) : SE_RESPONSE
require require
selinum_server_available: is_available selinum_server_available: is_available
local local
resp: HTTP_CLIENT_RESPONSE resp: HTTP_CLIENT_RESPONSE
do do
resp := execute_post (cmd_session_element_clear (a_session_id,id), Void) resp := execute_post (cmd_session_element_clear (a_session_id, id), Void)
Result := new_response (a_session_id, resp) Result := new_response (a_session_id, resp)
end end
is_enabled (a_session_id: STRING_32; id : STRING_32) : SE_RESPONSE is_enabled (a_session_id: STRING_32; id: STRING_32): SE_RESPONSE
require require
selinum_server_available: is_available selinum_server_available: is_available
local local
resp: HTTP_CLIENT_RESPONSE resp: HTTP_CLIENT_RESPONSE
do do
resp := execute_get (cmd_session_element_enabled (a_session_id,id)) resp := execute_get (cmd_session_element_enabled (a_session_id, id))
Result := new_response (a_session_id, resp) Result := new_response (a_session_id, resp)
end end
is_selected (a_session_id: STRING_32; id : STRING_32) : SE_RESPONSE is_selected (a_session_id: STRING_32; id: STRING_32): SE_RESPONSE
require require
selinum_server_available: is_available selinum_server_available: is_available
local local
resp: HTTP_CLIENT_RESPONSE resp: HTTP_CLIENT_RESPONSE
do do
resp := execute_get (cmd_session_element_selected (a_session_id,id)) resp := execute_get (cmd_session_element_selected (a_session_id, id))
Result := new_response (a_session_id, resp) Result := new_response (a_session_id, resp)
end end
element_value (a_session_id: STRING_32; id : STRING_32; name : STRING_32) : SE_RESPONSE element_value (a_session_id: STRING_32; id: STRING_32; name: STRING_32): SE_RESPONSE
require require
selinum_server_available: is_available selinum_server_available: is_available
local local
resp: HTTP_CLIENT_RESPONSE resp: HTTP_CLIENT_RESPONSE
do do
resp := execute_get (cmd_session_element_attribute_name (a_session_id,id,name)) resp := execute_get (cmd_session_element_attribute_name (a_session_id, id, name))
Result := new_response (a_session_id, resp) Result := new_response (a_session_id, resp)
end end
element_equals (a_session_id: STRING_32; id : STRING_32; other : STRING_32) : SE_RESPONSE element_equals (a_session_id: STRING_32; id: STRING_32; other: STRING_32): SE_RESPONSE
require require
selinum_server_available: is_available selinum_server_available: is_available
local local
resp: HTTP_CLIENT_RESPONSE resp: HTTP_CLIENT_RESPONSE
do do
resp := execute_get (cmd_session_element_equals (a_session_id,id,other)) resp := execute_get (cmd_session_element_equals (a_session_id, id, other))
Result := new_response (a_session_id, resp) Result := new_response (a_session_id, resp)
end end
is_displayed (a_session_id: STRING_32; id : STRING_32) : SE_RESPONSE is_displayed (a_session_id: STRING_32; id: STRING_32): SE_RESPONSE
require require
selinum_server_available: is_available selinum_server_available: is_available
local local
resp: HTTP_CLIENT_RESPONSE resp: HTTP_CLIENT_RESPONSE
do do
resp := execute_get (cmd_session_element_displayed (a_session_id,id)) resp := execute_get (cmd_session_element_displayed (a_session_id, id))
Result := new_response (a_session_id, resp) Result := new_response (a_session_id, resp)
end end
element_location (a_session_id: STRING_32; id : STRING_32) : SE_RESPONSE element_location (a_session_id: STRING_32; id: STRING_32): SE_RESPONSE
require require
selinum_server_available: is_available selinum_server_available: is_available
local local
resp: HTTP_CLIENT_RESPONSE resp: HTTP_CLIENT_RESPONSE
do do
resp := execute_get (cmd_session_element_location (a_session_id,id)) resp := execute_get (cmd_session_element_location (a_session_id, id))
Result := new_response (a_session_id, resp) Result := new_response (a_session_id, resp)
end end
location_in_view (a_session_id: STRING_32; id : STRING_32) : SE_RESPONSE location_in_view (a_session_id: STRING_32; id: STRING_32): SE_RESPONSE
require require
selinum_server_available: is_available selinum_server_available: is_available
local local
resp: HTTP_CLIENT_RESPONSE resp: HTTP_CLIENT_RESPONSE
do do
resp := execute_get (cmd_session_element_location_in_view (a_session_id,id)) resp := execute_get (cmd_session_element_location_in_view (a_session_id, id))
Result := new_response (a_session_id, resp) Result := new_response (a_session_id, resp)
end end
element_size (a_session_id: STRING_32; id: STRING_32): SE_RESPONSE
element_size (a_session_id: STRING_32; id : STRING_32) : SE_RESPONSE
require require
selinum_server_available: is_available selinum_server_available: is_available
local local
resp: HTTP_CLIENT_RESPONSE resp: HTTP_CLIENT_RESPONSE
do do
resp := execute_get (cmd_session_element_size (a_session_id,id)) resp := execute_get (cmd_session_element_size (a_session_id, id))
Result := new_response (a_session_id, resp) Result := new_response (a_session_id, resp)
end end
element_css_value (a_session_id: STRING_32; id : STRING_32; property_name : STRING_32) : SE_RESPONSE element_css_value (a_session_id: STRING_32; id: STRING_32; property_name: STRING_32): SE_RESPONSE
require require
selinum_server_available: is_available selinum_server_available: is_available
local local
resp: HTTP_CLIENT_RESPONSE resp: HTTP_CLIENT_RESPONSE
do do
resp := execute_get (cmd_session_element_css_value (a_session_id,id, property_name)) resp := execute_get (cmd_session_element_css_value (a_session_id, id, property_name))
Result := new_response (a_session_id, resp) Result := new_response (a_session_id, resp)
end end
retrieve_browser_orientation (a_session_id: STRING_32): SE_RESPONSE
retrieve_browser_orientation (a_session_id: STRING_32) : SE_RESPONSE
require require
selinum_server_available: is_available selinum_server_available: is_available
local local
@@ -655,8 +640,7 @@ feature -- Commands
Result := new_response (a_session_id, resp) Result := new_response (a_session_id, resp)
end end
set_browser_orientation (a_session_id: STRING_32; data: STRING_32): SE_RESPONSE
set_browser_orientation (a_session_id: STRING_32; data : STRING_32) : SE_RESPONSE
require require
selinum_server_available: is_available selinum_server_available: is_available
local local
@@ -666,7 +650,7 @@ feature -- Commands
Result := new_response (a_session_id, resp) Result := new_response (a_session_id, resp)
end end
retrieve_alert_text (a_session_id: STRING_32) : SE_RESPONSE retrieve_alert_text (a_session_id: STRING_32): SE_RESPONSE
require require
selinum_server_available: is_available selinum_server_available: is_available
local local
@@ -676,187 +660,181 @@ feature -- Commands
Result := new_response (a_session_id, resp) Result := new_response (a_session_id, resp)
end end
send_alert_text (a_session_id: STRING_32; data : STRING_32) : SE_RESPONSE send_alert_text (a_session_id: STRING_32; data: STRING_32): SE_RESPONSE
require require
selinum_server_available: is_available selinum_server_available: is_available
local local
resp: HTTP_CLIENT_RESPONSE resp: HTTP_CLIENT_RESPONSE
do do
resp := execute_post (cmd_session_alert_text (a_session_id),data) resp := execute_post (cmd_session_alert_text (a_session_id), data)
Result := new_response (a_session_id, resp) Result := new_response (a_session_id, resp)
end end
accept_alert (a_session_id: STRING_32) : SE_RESPONSE accept_alert (a_session_id: STRING_32): SE_RESPONSE
require require
selinum_server_available: is_available selinum_server_available: is_available
local local
resp: HTTP_CLIENT_RESPONSE resp: HTTP_CLIENT_RESPONSE
do do
resp := execute_post (cmd_session_accept_alert (a_session_id),Void) resp := execute_post (cmd_session_accept_alert (a_session_id), Void)
Result := new_response (a_session_id, resp) Result := new_response (a_session_id, resp)
end end
dismiss_alert (a_session_id: STRING_32) : SE_RESPONSE dismiss_alert (a_session_id: STRING_32): SE_RESPONSE
require require
selinum_server_available: is_available selinum_server_available: is_available
local local
resp: HTTP_CLIENT_RESPONSE resp: HTTP_CLIENT_RESPONSE
do do
resp := execute_post (cmd_session_dismiss_alert (a_session_id),Void) resp := execute_post (cmd_session_dismiss_alert (a_session_id), Void)
Result := new_response (a_session_id, resp) Result := new_response (a_session_id, resp)
end end
move_to (a_session_id: STRING_32; data : STRING_32) : SE_RESPONSE move_to (a_session_id: STRING_32; data: STRING_32): SE_RESPONSE
require require
selinum_server_available: is_available selinum_server_available: is_available
local local
resp: HTTP_CLIENT_RESPONSE resp: HTTP_CLIENT_RESPONSE
do do
resp := execute_post (cmd_session_move_to (a_session_id),data) resp := execute_post (cmd_session_move_to (a_session_id), data)
Result := new_response (a_session_id, resp) Result := new_response (a_session_id, resp)
end end
click (a_session_id: STRING_32; data: STRING_32): SE_RESPONSE
click (a_session_id: STRING_32; data : STRING_32) : SE_RESPONSE
require require
selinum_server_available: is_available selinum_server_available: is_available
local local
resp: HTTP_CLIENT_RESPONSE resp: HTTP_CLIENT_RESPONSE
do do
resp := execute_post (cmd_session_click (a_session_id),data) resp := execute_post (cmd_session_click (a_session_id), data)
Result := new_response (a_session_id, resp) Result := new_response (a_session_id, resp)
end end
button_down (a_session_id: STRING_32; data : STRING_32) : SE_RESPONSE button_down (a_session_id: STRING_32; data: STRING_32): SE_RESPONSE
require require
selinum_server_available: is_available selinum_server_available: is_available
local local
resp: HTTP_CLIENT_RESPONSE resp: HTTP_CLIENT_RESPONSE
do do
resp := execute_post (cmd_session_buttondown (a_session_id),data) resp := execute_post (cmd_session_buttondown (a_session_id), data)
Result := new_response (a_session_id, resp) Result := new_response (a_session_id, resp)
end end
button_up (a_session_id: STRING_32; data : STRING_32) : SE_RESPONSE button_up (a_session_id: STRING_32; data: STRING_32): SE_RESPONSE
require require
selinum_server_available: is_available selinum_server_available: is_available
local local
resp: HTTP_CLIENT_RESPONSE resp: HTTP_CLIENT_RESPONSE
do do
resp := execute_post (cmd_session_buttonup (a_session_id),data) resp := execute_post (cmd_session_buttonup (a_session_id), data)
Result := new_response (a_session_id, resp) Result := new_response (a_session_id, resp)
end end
double_click (a_session_id: STRING_32) : SE_RESPONSE double_click (a_session_id: STRING_32): SE_RESPONSE
require require
selinum_server_available: is_available selinum_server_available: is_available
local local
resp: HTTP_CLIENT_RESPONSE resp: HTTP_CLIENT_RESPONSE
do do
resp := execute_post (cmd_session_double_click (a_session_id),Void) resp := execute_post (cmd_session_double_click (a_session_id), Void)
Result := new_response (a_session_id, resp) Result := new_response (a_session_id, resp)
end end
touch_click (a_session_id: STRING_32; data: STRING_32): SE_RESPONSE
touch_click (a_session_id: STRING_32; data : STRING_32) : SE_RESPONSE
require require
selinum_server_available: is_available selinum_server_available: is_available
local local
resp: HTTP_CLIENT_RESPONSE resp: HTTP_CLIENT_RESPONSE
do do
resp := execute_post (cmd_session_touch_click (a_session_id),data) resp := execute_post (cmd_session_touch_click (a_session_id), data)
Result := new_response (a_session_id, resp) Result := new_response (a_session_id, resp)
end end
touch_down (a_session_id: STRING_32; data : STRING_32) : SE_RESPONSE touch_down (a_session_id: STRING_32; data: STRING_32): SE_RESPONSE
require require
selinum_server_available: is_available selinum_server_available: is_available
local local
resp: HTTP_CLIENT_RESPONSE resp: HTTP_CLIENT_RESPONSE
do do
resp := execute_post (cmd_session_touch_down (a_session_id),data) resp := execute_post (cmd_session_touch_down (a_session_id), data)
Result := new_response (a_session_id, resp) Result := new_response (a_session_id, resp)
end end
touch_up (a_session_id: STRING_32; data : STRING_32) : SE_RESPONSE touch_up (a_session_id: STRING_32; data: STRING_32): SE_RESPONSE
require require
selinum_server_available: is_available selinum_server_available: is_available
local local
resp: HTTP_CLIENT_RESPONSE resp: HTTP_CLIENT_RESPONSE
do do
resp := execute_post (cmd_session_touch_up (a_session_id),data) resp := execute_post (cmd_session_touch_up (a_session_id), data)
Result := new_response (a_session_id, resp) Result := new_response (a_session_id, resp)
end end
touch_move (a_session_id: STRING_32; data : STRING_32) : SE_RESPONSE touch_move (a_session_id: STRING_32; data: STRING_32): SE_RESPONSE
require require
selinum_server_available: is_available selinum_server_available: is_available
local local
resp: HTTP_CLIENT_RESPONSE resp: HTTP_CLIENT_RESPONSE
do do
resp := execute_post (cmd_session_touch_move (a_session_id),data) resp := execute_post (cmd_session_touch_move (a_session_id), data)
Result := new_response (a_session_id, resp) Result := new_response (a_session_id, resp)
end end
start_touch_scroll (a_session_id: STRING_32; data : STRING_32) : SE_RESPONSE start_touch_scroll (a_session_id: STRING_32; data: STRING_32): SE_RESPONSE
require require
selinum_server_available: is_available selinum_server_available: is_available
local local
resp: HTTP_CLIENT_RESPONSE resp: HTTP_CLIENT_RESPONSE
do do
resp := execute_post (cmd_session_touch_scroll (a_session_id),data) resp := execute_post (cmd_session_touch_scroll (a_session_id), data)
Result := new_response (a_session_id, resp) Result := new_response (a_session_id, resp)
end end
touch_scroll (a_session_id: STRING_32; data: STRING_32): SE_RESPONSE
touch_scroll (a_session_id: STRING_32; data : STRING_32) : SE_RESPONSE
require require
selinum_server_available: is_available selinum_server_available: is_available
do do
Result := start_touch_scroll (a_session_id, data) Result := start_touch_scroll (a_session_id, data)
end end
touch_double_click (a_session_id: STRING_32; data : STRING_32) : SE_RESPONSE touch_double_click (a_session_id: STRING_32; data: STRING_32): SE_RESPONSE
require require
selinum_server_available: is_available selinum_server_available: is_available
local local
resp: HTTP_CLIENT_RESPONSE resp: HTTP_CLIENT_RESPONSE
do do
resp := execute_post (cmd_session_touch_double_click (a_session_id),data) resp := execute_post (cmd_session_touch_double_click (a_session_id), data)
Result := new_response (a_session_id, resp) Result := new_response (a_session_id, resp)
end end
touch_long_click (a_session_id: STRING_32; data: STRING_32): SE_RESPONSE
touch_long_click (a_session_id: STRING_32; data : STRING_32) : SE_RESPONSE
require require
selinum_server_available: is_available selinum_server_available: is_available
local local
resp: HTTP_CLIENT_RESPONSE resp: HTTP_CLIENT_RESPONSE
do do
resp := execute_post (cmd_session_touch_long_click (a_session_id),data) resp := execute_post (cmd_session_touch_long_click (a_session_id), data)
Result := new_response (a_session_id, resp) Result := new_response (a_session_id, resp)
end end
start_touch_flick (a_session_id: STRING_32; data : STRING_32) : SE_RESPONSE start_touch_flick (a_session_id: STRING_32; data: STRING_32): SE_RESPONSE
require require
selinum_server_available: is_available selinum_server_available: is_available
local local
resp: HTTP_CLIENT_RESPONSE resp: HTTP_CLIENT_RESPONSE
do do
resp := execute_post (cmd_session_touch_flick (a_session_id),data) resp := execute_post (cmd_session_touch_flick (a_session_id), data)
Result := new_response (a_session_id, resp) Result := new_response (a_session_id, resp)
end end
touch_flick (a_session_id: STRING_32; data: STRING_32): SE_RESPONSE
touch_flick (a_session_id: STRING_32; data : STRING_32) : SE_RESPONSE
require require
selinum_server_available: is_available selinum_server_available: is_available
do do
Result := start_touch_flick (a_session_id, data) Result := start_touch_flick (a_session_id, data)
end end
retrieve_geo_location (a_session_id: STRING_32): SE_RESPONSE
retrieve_geo_location (a_session_id: STRING_32) : SE_RESPONSE
require require
selinum_server_available: is_available selinum_server_available: is_available
local local
@@ -866,17 +844,17 @@ feature -- Commands
Result := new_response (a_session_id, resp) Result := new_response (a_session_id, resp)
end end
set_geo_location (a_session_id: STRING_32; data : STRING_32) : SE_RESPONSE set_geo_location (a_session_id: STRING_32; data: STRING_32): SE_RESPONSE
require require
selinum_server_available: is_available selinum_server_available: is_available
local local
resp: HTTP_CLIENT_RESPONSE resp: HTTP_CLIENT_RESPONSE
do do
resp := execute_post (cmd_session_geo_location (a_session_id),data) resp := execute_post (cmd_session_geo_location (a_session_id), data)
Result := new_response (a_session_id, resp) Result := new_response (a_session_id, resp)
end end
retrieve_local_storage (a_session_id: STRING_32) : SE_RESPONSE retrieve_local_storage (a_session_id: STRING_32): SE_RESPONSE
require require
selinum_server_available: is_available selinum_server_available: is_available
local local
@@ -886,17 +864,17 @@ feature -- Commands
Result := new_response (a_session_id, resp) Result := new_response (a_session_id, resp)
end end
set_location_storage (a_session_id: STRING_32; data : STRING_32) : SE_RESPONSE set_location_storage (a_session_id: STRING_32; data: STRING_32): SE_RESPONSE
require require
selinum_server_available: is_available selinum_server_available: is_available
local local
resp: HTTP_CLIENT_RESPONSE resp: HTTP_CLIENT_RESPONSE
do do
resp := execute_post (cmd_session_local_storage (a_session_id),data) resp := execute_post (cmd_session_local_storage (a_session_id), data)
Result := new_response (a_session_id, resp) Result := new_response (a_session_id, resp)
end end
delete_local_storage (a_session_id: STRING_32) : SE_RESPONSE delete_local_storage (a_session_id: STRING_32): SE_RESPONSE
require require
selinum_server_available: is_available selinum_server_available: is_available
local local
@@ -906,27 +884,27 @@ feature -- Commands
Result := new_response (a_session_id, resp) Result := new_response (a_session_id, resp)
end end
retrieve_storage_by_key (a_session_id: STRING_32; key : STRING_32) : SE_RESPONSE retrieve_storage_by_key (a_session_id: STRING_32; key: STRING_32): SE_RESPONSE
require require
selinum_server_available: is_available selinum_server_available: is_available
local local
resp: HTTP_CLIENT_RESPONSE resp: HTTP_CLIENT_RESPONSE
do do
resp := execute_get (cmd_session_local_storage_key (a_session_id,key)) resp := execute_get (cmd_session_local_storage_key (a_session_id, key))
Result := new_response (a_session_id, resp) Result := new_response (a_session_id, resp)
end end
delete_storage_by_key (a_session_id: STRING_32; key : STRING_32) : SE_RESPONSE delete_storage_by_key (a_session_id: STRING_32; key: STRING_32): SE_RESPONSE
require require
selinum_server_available: is_available selinum_server_available: is_available
local local
resp: HTTP_CLIENT_RESPONSE resp: HTTP_CLIENT_RESPONSE
do do
resp := execute_delete (cmd_session_local_storage_key (a_session_id,key)) resp := execute_delete (cmd_session_local_storage_key (a_session_id, key))
Result := new_response (a_session_id, resp) Result := new_response (a_session_id, resp)
end end
local_storage_size (a_session_id: STRING_32) : SE_RESPONSE local_storage_size (a_session_id: STRING_32): SE_RESPONSE
require require
selinum_server_available: is_available selinum_server_available: is_available
local local
@@ -936,7 +914,7 @@ feature -- Commands
Result := new_response (a_session_id, resp) Result := new_response (a_session_id, resp)
end end
session_storage_keys (a_session_id: STRING_32) : SE_RESPONSE session_storage_keys (a_session_id: STRING_32): SE_RESPONSE
require require
selinum_server_available: is_available selinum_server_available: is_available
local local
@@ -946,17 +924,17 @@ feature -- Commands
Result := new_response (a_session_id, resp) Result := new_response (a_session_id, resp)
end end
set_session_storage (a_session_id: STRING_32; data : STRING_32) : SE_RESPONSE set_session_storage (a_session_id: STRING_32; data: STRING_32): SE_RESPONSE
require require
selinum_server_available: is_available selinum_server_available: is_available
local local
resp: HTTP_CLIENT_RESPONSE resp: HTTP_CLIENT_RESPONSE
do do
resp := execute_post (cmd_session_storage (a_session_id),data) resp := execute_post (cmd_session_storage (a_session_id), data)
Result := new_response (a_session_id, resp) Result := new_response (a_session_id, resp)
end end
delete_session_storage (a_session_id: STRING_32) : SE_RESPONSE delete_session_storage (a_session_id: STRING_32): SE_RESPONSE
require require
selinum_server_available: is_available selinum_server_available: is_available
local local
@@ -966,27 +944,27 @@ feature -- Commands
Result := new_response (a_session_id, resp) Result := new_response (a_session_id, resp)
end end
retrive_storage_item_by_key (a_session_id: STRING_32; key : STRING_32) : SE_RESPONSE retrive_storage_item_by_key (a_session_id: STRING_32; key: STRING_32): SE_RESPONSE
require require
selinum_server_available: is_available selinum_server_available: is_available
local local
resp: HTTP_CLIENT_RESPONSE resp: HTTP_CLIENT_RESPONSE
do do
resp := execute_get (cmd_session_storage_key (a_session_id,key)) resp := execute_get (cmd_session_storage_key (a_session_id, key))
Result := new_response (a_session_id, resp) Result := new_response (a_session_id, resp)
end end
remove_storage_item_by_key (a_session_id: STRING_32; key : STRING_32) : SE_RESPONSE remove_storage_item_by_key (a_session_id: STRING_32; key: STRING_32): SE_RESPONSE
require require
selinum_server_available: is_available selinum_server_available: is_available
local local
resp: HTTP_CLIENT_RESPONSE resp: HTTP_CLIENT_RESPONSE
do do
resp := execute_delete (cmd_session_storage_key (a_session_id,key)) resp := execute_delete (cmd_session_storage_key (a_session_id, key))
Result := new_response (a_session_id, resp) Result := new_response (a_session_id, resp)
end end
session_storage_size (a_session_id: STRING_32) : SE_RESPONSE session_storage_size (a_session_id: STRING_32): SE_RESPONSE
require require
selinum_server_available: is_available selinum_server_available: is_available
local local
@@ -996,17 +974,17 @@ feature -- Commands
Result := new_response (a_session_id, resp) Result := new_response (a_session_id, resp)
end end
log (a_session_id: STRING_32; data : STRING_32) : SE_RESPONSE log (a_session_id: STRING_32; data: STRING_32): SE_RESPONSE
require require
selinum_server_available: is_available selinum_server_available: is_available
local local
resp: HTTP_CLIENT_RESPONSE resp: HTTP_CLIENT_RESPONSE
do do
resp := execute_post (cmd_session_log (a_session_id),data) resp := execute_post (cmd_session_log (a_session_id), data)
Result := new_response (a_session_id, resp) Result := new_response (a_session_id, resp)
end end
available_log_types (a_session_id: STRING_32) : SE_RESPONSE available_log_types (a_session_id: STRING_32): SE_RESPONSE
require require
selinum_server_available: is_available selinum_server_available: is_available
local local
@@ -1016,7 +994,7 @@ feature -- Commands
Result := new_response (a_session_id, resp) Result := new_response (a_session_id, resp)
end end
application_cache_status (a_session_id: STRING_32) : SE_RESPONSE application_cache_status (a_session_id: STRING_32): SE_RESPONSE
require require
selinum_server_available: is_available selinum_server_available: is_available
local local
@@ -1043,7 +1021,7 @@ feature {NONE} -- Implementation
Result := http_session.delete (command_name, context_executor) Result := http_session.delete (command_name, context_executor)
end end
new_response (a_session_id : STRING_32; resp: HTTP_CLIENT_RESPONSE): SE_RESPONSE new_response (a_session_id: STRING_32; resp: HTTP_CLIENT_RESPONSE): SE_RESPONSE
-- Create a new Selenium Response based on `resp' HTTP_RESPONSE -- Create a new Selenium Response based on `resp' HTTP_RESPONSE
-- todo improve it!!! -- todo improve it!!!
do do
@@ -1053,7 +1031,7 @@ feature {NONE} -- Implementation
Result.set_session_id (a_session_id) Result.set_session_id (a_session_id)
else else
if attached resp.body as l_body then if attached resp.body as l_body then
if attached json_to_se_response(l_body) as l_response then if attached json_to_se_response (l_body) as l_response then
Result := l_response Result := l_response
end end
Result.set_json_response (l_body) Result.set_json_response (l_body)