mailman3.common-lisp.net
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
List overview
Download
cl-selenium-cvs
July 2008
----- 2024 -----
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
cl-selenium-cvs@common-lisp.net
1 participants
2 discussions
Start a n
N
ew thread
[cl-selenium-cvs] CVS cl-selenium
by mkennedy
02 Jul '08
02 Jul '08
Update of /project/cl-selenium/cvsroot/cl-selenium In directory clnet:/tmp/cvs-serv11275 Modified Files: selenium.lisp selenium.asd packages.lisp iedoc.lisp ChangeLog Log Message: Add convenience method with-selenium-session. Update driver URL to be Selenium RC default. --- /project/cl-selenium/cvsroot/cl-selenium/selenium.lisp 2008/07/01 06:53:30 1.4 +++ /project/cl-selenium/cvsroot/cl-selenium/selenium.lisp 2008/07/02 03:33:12 1.5 @@ -25,3 +25,13 @@ (cons `("sessionId" . ,session) (marshall-request "testComplete")))) +(defmacro with-selenium-session ((var browser url) &body body) + "Evaluate BODY within a Selenium RC session specified by VAR. +Once the body is evaluated, the test complete command is sent which +closes the session and browser." + `(let ((,var (do-get-new-browser-session ,browser ,url))) + (unwind-protect + (progn + ,@body) + (when ,var + (do-test-complete ,var))))) --- /project/cl-selenium/cvsroot/cl-selenium/selenium.asd 2008/01/20 20:01:43 1.1.1.1 +++ /project/cl-selenium/cvsroot/cl-selenium/selenium.asd 2008/07/02 03:33:12 1.2 @@ -1,3 +1,4 @@ + (defpackage #:selenium-system (:use #:common-lisp #:asdf)) (in-package #:selenium-system) --- /project/cl-selenium/cvsroot/cl-selenium/packages.lisp 2008/01/24 15:40:40 1.2 +++ /project/cl-selenium/cvsroot/cl-selenium/packages.lisp 2008/07/02 03:33:12 1.3 @@ -1,3 +1,4 @@ + (defpackage #:selenium (:use #:common-lisp) (:documentation "An interface to Selenium Remote Control.") @@ -8,4 +9,5 @@ #:do-test-complete #:base-error #:http-error - #:execution-error)) + #:execution-error + #:with-selenium-session)) --- /project/cl-selenium/cvsroot/cl-selenium/iedoc.lisp 2008/07/01 06:53:30 1.4 +++ /project/cl-selenium/cvsroot/cl-selenium/iedoc.lisp 2008/07/02 03:33:12 1.5 @@ -1,3 +1,4 @@ + (in-package #:selenium) (defclass iedoc-function () @@ -175,7 +176,7 @@ #+nil (mapcar #'convert-function (parse-iedoc #p"/home/mkennedy/src/cl-selenium/iedoc-0.8.3-1879.xml")) -(defvar *selenium-driver-url* (puri:parse-uri "
http://localhost:9999/selenium-server/driver/
") +(defvar *selenium-driver-url* (puri:parse-uri "
http://localhost:4444/selenium-server/driver
") "The URL of the Selenium Remote Control server.") (defvar *selenium-session* nil --- /project/cl-selenium/cvsroot/cl-selenium/ChangeLog 2008/07/01 06:53:30 1.4 +++ /project/cl-selenium/cvsroot/cl-selenium/ChangeLog 2008/07/02 03:33:12 1.5 @@ -1,5 +1,10 @@ 2008-07-01 Matthew Kennedy + * selenium.lisp (with-selenium-session): New convenience method. + * iedoc.lisp (*selenium-driver-url*): Change value to Selenium RC default. + +2008-07-01 Matthew Kennedy + * iedoc.lisp (marshall-request): Change the result to an associative list of parameters which can be passed to Drakma's http-request function. This way we don't have to do our own URL
1
0
0
0
[cl-selenium-cvs] CVS cl-selenium
by mkennedy
01 Jul '08
01 Jul '08
Update of /project/cl-selenium/cvsroot/cl-selenium In directory clnet:/tmp/cvs-serv14903 Modified Files: selenium.lisp iedoc.lisp ChangeLog Log Message: Don't do our own URL encoding. --- /project/cl-selenium/cvsroot/cl-selenium/selenium.lisp 2008/05/19 06:37:05 1.3 +++ /project/cl-selenium/cvsroot/cl-selenium/selenium.lisp 2008/07/01 06:53:30 1.4 @@ -15,14 +15,13 @@ (defun do-get-new-browser-session (browser url) "Create a session by using the the given browser and initial URL." - (execute (puri:merge-uris (make-instance 'puri:uri :query (marshall-request "getNewBrowserSession" browser url)) - *selenium-driver-url*) + (execute *selenium-driver-url* + (marshall-request "getNewBrowserSession" browser url) 'string)) (defun do-test-complete (&optional (session *selenium-session*)) - (let ((query (concatenate 'string - "cmd=testComplete&sessionId=" - (format nil "~A" session)))) - (execute (puri:merge-uris (make-instance 'puri:uri :query query) - *selenium-driver-url*)))) + "Destroy session, closing the browser." + (execute *selenium-driver-url* + (cons `("sessionId" . ,session) + (marshall-request "testComplete")))) --- /project/cl-selenium/cvsroot/cl-selenium/iedoc.lisp 2008/05/19 06:37:05 1.3 +++ /project/cl-selenium/cvsroot/cl-selenium/iedoc.lisp 2008/07/01 06:53:30 1.4 @@ -81,35 +81,13 @@ (convert-parameter-name (iedoc-parameter-name parameter))) iedoc-function-parameters)) -(defun replace-all (string part replacement &key (test #'char=)) - "Returns a new string in which all the occurences of the part - is replaced with replacement." - (with-output-to-string (out) - (loop with part-length = (length part) - for old-pos = 0 then (+ pos part-length) - for pos = (search part string - :start2 old-pos - :test test) - do (write-string string out - :start old-pos - :end (or pos (length string))) - when pos do (write-string replacement out) - while pos))) - -(defun encode (s) - ;;; Must replace % first! - (loop for disallowed-char in '("%" " " "<" ">" "#" "{" "}" "|" "\\" "^" - "~" "[" "]" "`" ";" "/" "?" ":" "@" "=" "&" - "$") - do - (setf s (replace-all s disallowed-char (format nil "%~x" (char-code (elt disallowed-char 0)))))) - s) - (defun marshall-request (command &rest parameters) - (with-output-to-string (stream) - (format stream "cmd=~A" command #+nil(html-encode:encode-for-http "asdf% asdf")) - (dotimes (i (length parameters)) - (format stream "&~D=~A" (1+ i) (encode (elt parameters i)))))) + (cons `("cmd" . ,command) + (let ((argument-count 0)) + (mapcar #'(lambda (parameter) + (cons (format nil "~D" (incf argument-count)) + (format nil "~A" parameter))) + parameters)))) (defun starts-with (s prefix) "Returns t if s starts with prefix" @@ -170,9 +148,9 @@ (format s "Selenium execution error: ~A" (description c))))) -(defun execute (url &optional return-type) +(defun execute (url parameters &optional return-type) (multiple-value-bind (reply status-code headers reply-from stream some-bool reason) - (drakma:http-request url :method :get) + (drakma:http-request url :method :get :parameters parameters) (declare (ignore headers reply-from stream some-bool)) (when (/= 200 status-code) (error 'http-error :status-code status-code :reason reason)) @@ -189,14 +167,13 @@ `(defun ,function-name (,@parameters &optional (session *selenium-session*)) ,(iedoc-function-comment iedoc-function) - (let ((query (concatenate 'string - (marshall-request ,(iedoc-function-name iedoc-function) ,@parameters) - (format nil "&sessionId=~d" session)))) - (execute (puri:merge-uris (make-instance 'puri:uri :query query) - *selenium-driver-url*) + (let ((parameters (cons `("sessionId" . ,session) + (marshall-request ,(iedoc-function-name iedoc-function) ,@parameters)))) + (execute *selenium-driver-url* + parameters ',(iedoc-return-type iedoc-function)))))) -#+nil (mapcar #'convert-function (parse-iedoc #p"/selenium-core-0.8.2/core/iedoc.xml")) +#+nil (mapcar #'convert-function (parse-iedoc #p"/home/mkennedy/src/cl-selenium/iedoc-0.8.3-1879.xml")) (defvar *selenium-driver-url* (puri:parse-uri "
http://localhost:9999/selenium-server/driver/
") "The URL of the Selenium Remote Control server.") --- /project/cl-selenium/cvsroot/cl-selenium/ChangeLog 2008/05/19 06:37:05 1.3 +++ /project/cl-selenium/cvsroot/cl-selenium/ChangeLog 2008/07/01 06:53:30 1.4 @@ -1,3 +1,10 @@ +2008-07-01 Matthew Kennedy + + * iedoc.lisp (marshall-request): Change the result to an + associative list of parameters which can be passed to Drakma's + http-request function. This way we don't have to do our own URL + encoding. Thanks to Robin Lee Powell for noting this problem. + 2008-05-19 Matthew Kennedy * iedoc.lisp, selenium.lisp: Apply patch from Chaitanya Gupta to
1
0
0
0
Results per page:
10
25
50
100
200