Closed tarekziade closed 7 years ago
Here's a working example
https://github.com/tarekziade/molosonic/blob/master/loadtest.py
notice that I had to hack around the context manager. It's nice to have context managers, but I think it should not be mandatory to use the classes.
I like how aiohttp does it. e.g. you can use the Session objects in regular code by initializing it and closing it manually, or if you want you can use the context manager so it does that for you.
Turned out it was my lack of understanding of the implementation. After more work, I was able to use it without context manager. Sorry ;)
https://github.com/tarekziade/molosonic/blob/master/loadtest.py#L23-L53
The Firefox class I have implemented would be the high level API I was talking about
The split between driver/session which leads to a kind of low level API was initially done because I (wrongly) assumed you could have multiple sessions per driver. At least for Geckodriver that seems to not be the case, so I'm considering adding a higher level "just give me a browser session" API that combines the two.
api has changed to higher level, closing this.
I am wondering if we could simplify the API usage by providing a high level class that does everything one would expect when running a Firefox session.
Something like:
what do you think?