Looking forward to collaborating...
Richard, recently heard of your work through the recent webinar Bryan Lamb gave over @SauceLabs. I have done similar work bringing AngularJS into Selenium2Library. We have had several discussions about how best to integrate custom locators and are still working through several ideas. I am looking forward to seeing your work and collaborating.
The AngularJS locators are one part that is still not in this library. Most I've done is to add AngularJS synchronization support in Selenium2Library. I am looking forward to collaborate with you in the future.
Hi ricky,
I have an understanding question. Could I describe it here please. Because its an understanding issue for me, I would not like to create an issue
My query:
Based on the link below: https://github.com/rickypc/robotframework-extendedselenium2library/blob/master/src/ExtendedSelenium2Library/init.py
At times, to the "WebDriverWait" Method we are passing, different browser (driver) instances as a. None b. browser c. self
example: a. WebDriverWait(None, timeout, self._poll_frequency) b. WebDriverWait(browser, timeout, self._poll_frequency) c. WebDriverWait(self, timeout, self._poll_frequency)
What is the logic behind passing "None" or "self" Should we not always pass "browser/driver" instance to WebDriverWait method ?
Thank you
With Regards, Rama
Very good question, Rama.
To answer your question, we need to look further on how we are gonna use the WebDriverWait.until/until_not method. The first argument of WebDriverWait will be passed in to the predicate method/function of until/until_not. The value passed in as the first argument of the WebDriverWait will depend on what the predicate method/function would need to process. Hence you saw there are variation of values being used.
For example: wait_for_async_condition method would need to execute async Javascript. To execute async Javascript function, we would need the browser instance. Thus we need to passed in the browser instance as the WebDriverWait first argument. WebDriverWait will then passed in that browser instance to the lambda function and we would be able to execute the async Javascript from inside the lambda function.
Hope that makes sense.
Thank you very much for the detailed explanation. I find the reference / hints very helpful
After giving a thought, I find the example; corresponding to "first argument of WebDriverWait will be passed in to the predicate method/function of until/until_not" perfectly fits : )
With best regards, Rama
HI rickypc and emanlove,
i saw you both are contributing to add angularjs in s2l in robot framework.
i am wondering whether you can provide some kind of add on instead of wrapping the s2l in your extended library.
BR Zhehao
Hi Zhehao,
That is a very interesting idea. The reason on why I wrapped it around S2L because most keywords that I need to synchronize with AngularJS readiness came from S2L, for example "Click Link". So instead of I need to call 2 keywords, "Click Link" itself and "Wait Until Angular Ready" on every click link action, I could simply call one keyword "Click Link".
The other reason, I would like to contribute the code back to S2L project at some point in the future, once everything more solid, have unit tests, and test coverage for it.
Zhehao, please let me know if you have any scenario that would benefit more from add-on approach, maybe we could figure something out.
The other reason for providing this functionality in a separate library is that we could version it and pin it to various AngularJS releases. So if the library needs support an AngularJS 1.x functionality and a different AngualrJS 2.x feature we can do this by making separate releases. Putting it directly into Selenium2Library we couldn't and would be tied to their releases. A few of the Selenium2Library core contributors had a discussion about releasing AngularJS support within the library and this was the main argument for not doing so.
As @rickypc asked is there any scenario that you have @zhehaoshi that either one of our libraries isn't fitting?
I have a scenario this approach has issues with - we're trying to use both ExtendedSelenium2Library and robotframework-pageobjects (https://github.com/ncbi/robotframework-pageobjects) which itself uses Selenium2Library, like I'd imagine other addons do. By not being in Selenium2Library we're having to override and hack our own core page object definition with parts from both pageobjects and extendedselenium2library...
@ernestm I have the same approach, as of now, have not got into issues
Hi, I am the new maintainer of the Selenium2Library. Hi
We are doing some proof on concept work for the Selenium2Library new architecture. The architecture is based on idea to use Robot Framework dynamic library API and remove Selenium2Library multi inheritance from the library. Also we are planning to introduce a context object which would contain information from the current driver/browser. Also we are thinking to introduce a Base class, which could contain example the logging methods and some other common functionality for the library. The Base class would be inherit by other keyword classes, but the idea of the Base class is still little bit in the air and I am not yet sure is it good idea to implement.
The new architecture is based on this idea: https://github.com/robotframework/PythonLibCore and we did get the PoC working for Open Browser and Close All Browsers` keywords. More details about the PoC code can be example found from here: https://github.com/aaltat/robotframework-selenium2library/blob/new_arc/src/Selenium2Library/init.py#L179, https://github.com/aaltat/robotframework-selenium2library/blob/new_arc/src/Selenium2Library/keywords/browsermanagement.py#L76 and https://github.com/aaltat/robotframework-selenium2library/blob/new_arc/src/Selenium2Library/keywords/browsermanagement.py#L37
By doing the new architecture we might introduce changes which breaks the ExtendedSelenium2Library support for the Selenium2Library release 2.0. Therefore is there something that we could do on the Selenium2Library side, which would make easier for ExtendedSelenium2Library to support Selenium2Library 2.0 release.
Also if you are interested, would it be possible to introduce some of the extensions in the Selenium2Library.