More API
This commit is contained in:
parent
2cc08210f4
commit
05b5ee8a1b
|
@ -113,6 +113,36 @@ WDElement >> element: anObject [
|
|||
element := anObject
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
WDElement >> findElement: elemSelector using: locStrategy [
|
||||
|
||||
| reply |
|
||||
reply := driver
|
||||
sendWithSession: {
|
||||
(#using -> locStrategy).
|
||||
(#value -> elemSelector)
|
||||
}
|
||||
to: 'element/' , element , '/element'
|
||||
using: #POST.
|
||||
^ self class new
|
||||
driver: driver;
|
||||
element: reply values first.
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
WDElement >> findElements: elemSelector using: locStrategy [
|
||||
|
||||
| reply |
|
||||
reply := driver
|
||||
sendWithSession: {
|
||||
(#using -> locStrategy).
|
||||
(#value -> elemSelector)
|
||||
}
|
||||
to: 'element/' , element , '/elements'
|
||||
using: #POST.
|
||||
^ reply collect: [ :elem | self class new driver: driver; element: elem values first. ]
|
||||
]
|
||||
|
||||
{ #category : #'private - utilities' }
|
||||
WDElement >> inspectionWDElement [
|
||||
<inspectorPresentationOrder: 10 title: 'DOM Element'>
|
||||
|
|
|
@ -106,6 +106,20 @@ WebDriver >> deleteSession [
|
|||
self send: { } to: 'session/' , sessionId using: #DELETE
|
||||
]
|
||||
|
||||
{ #category : #simulating }
|
||||
WebDriver >> executeAsync: script with: args [
|
||||
^ self sendWithSession: { #script -> script . #args -> args }
|
||||
to: 'execute/async'
|
||||
using: #POST.
|
||||
]
|
||||
|
||||
{ #category : #simulating }
|
||||
WebDriver >> executeSync: script with: args [
|
||||
^ self sendWithSession: { #script -> script . #args -> args }
|
||||
to: 'execute/sync'
|
||||
using: #POST.
|
||||
]
|
||||
|
||||
{ #category : #finalization }
|
||||
WebDriver >> finalize [
|
||||
|
||||
|
@ -186,12 +200,22 @@ WebDriver >> postprocessResult: result [
|
|||
^ result.
|
||||
]
|
||||
|
||||
{ #category : #utilities }
|
||||
WebDriver >> print [
|
||||
^ self sendWithSession: { } to: 'print' using: #POST.
|
||||
]
|
||||
|
||||
{ #category : #navigation }
|
||||
WebDriver >> refresh [
|
||||
|
||||
self send: { } to: 'session/' , sessionId , '/refresh' using: #POST
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
WebDriver >> screenshot [
|
||||
^ (self sendWithSession: '' to: 'screenshot' using: #GET) base64Decoded.
|
||||
]
|
||||
|
||||
{ #category : #'private - utilities' }
|
||||
WebDriver >> send: dict to: url using: method [
|
||||
|result|
|
||||
|
|
Loading…
Reference in New Issue