Update find element examples.
Improved command executor
This commit is contained in:
@@ -44,7 +44,7 @@ feature -- Search by id
|
|||||||
|
|
||||||
|
|
||||||
-- Find links
|
-- Find links
|
||||||
if attached {ARRAYED_LIST[WEB_ELEMENT]}web_driver.find_elements ((create {SE_BY}).tag_name("a")) as l_links then
|
if attached web_driver.find_elements ((create {SE_BY}).tag_name("a")) as l_links then
|
||||||
from
|
from
|
||||||
l_links.start
|
l_links.start
|
||||||
until
|
until
|
||||||
@@ -62,4 +62,11 @@ feature -- Search by id
|
|||||||
web_driver.window_close
|
web_driver.window_close
|
||||||
end
|
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
|
end
|
||||||
|
|||||||
@@ -29,6 +29,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_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
|
||||||
@@ -61,12 +62,8 @@ feature -- Commands
|
|||||||
do
|
do
|
||||||
create Result.make_empty
|
create Result.make_empty
|
||||||
resp := execute_post (cmd_new_session, capabilities)
|
resp := execute_post (cmd_new_session, capabilities)
|
||||||
-- TODO move this scenario to feature new_response
|
|
||||||
if not (resp.status >= 400) then
|
if not (resp.status >= 400) then
|
||||||
if attached resp.header ("Location") as l_location then
|
|
||||||
resp := http_session.get (l_location.substring ((host.count+1),l_location.count), context_executor)
|
|
||||||
Result := new_response ("", resp)
|
Result := new_response ("", resp)
|
||||||
end
|
|
||||||
else
|
else
|
||||||
Result := new_response ("", resp)
|
Result := new_response ("", resp)
|
||||||
end
|
end
|
||||||
@@ -815,8 +812,6 @@ feature -- Commands
|
|||||||
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
|
||||||
local
|
|
||||||
resp: HTTP_CLIENT_RESPONSE
|
|
||||||
do
|
do
|
||||||
Result := start_touch_scroll (a_session_id, data)
|
Result := start_touch_scroll (a_session_id, data)
|
||||||
end
|
end
|
||||||
@@ -856,8 +851,6 @@ feature -- Commands
|
|||||||
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
|
||||||
local
|
|
||||||
resp: HTTP_CLIENT_RESPONSE
|
|
||||||
do
|
do
|
||||||
Result := start_touch_flick (a_session_id, data)
|
Result := start_touch_flick (a_session_id, data)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user