Skip to content

Commit ea577f5

Browse files
committed
added import, gave abstractions command_iterator class, added .to_json()
1 parent 1f035d2 commit ea577f5

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

py/selenium/webdriver/common/bidi/network.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18+
import uuid
1819
from .session import session_subscribe
1920
from .session import session_unsubscribe
2021

@@ -46,7 +47,7 @@ def __init__(self, conn):
4647

4748
def command_iterator(self, command):
4849
"""Generator to yield command."""
49-
yield command
50+
yield command.to_json()
5051

5152
def has_callbacks(self):
5253
"""Checks if there are any callbacks set."""
@@ -235,6 +236,10 @@ def continue_request(self):
235236
command = {'method': 'network.continueRequest', 'params': params}
236237
self.network.conn.execute(self.command_iterator(command))
237238

239+
def command_iterator(self, command):
240+
"""Generator to yield command."""
241+
yield command.to_json()
242+
238243
class Response:
239244
def __init__(self, request_id, url, status_code, headers, body, network: Network):
240245
self.request_id = request_id
@@ -256,3 +261,7 @@ def continue_response(self):
256261
params['body'] = self.body
257262
command = {'method': 'network.continueResponse', 'params': params}
258263
self.network.conn.execute(self.command_iterator(command))
264+
265+
def command_iterator(self, command):
266+
"""Generator to yield command."""
267+
yield command.to_json()

0 commit comments

Comments
 (0)