robotframework-extendedselenium2library icon indicating copy to clipboard operation
robotframework-extendedselenium2library copied to clipboard

Looking forward to collaborating...

Open emanlove opened this issue 10 years ago • 10 comments

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.

emanlove avatar Jun 27 '15 12:06 emanlove

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.

rickypc avatar Jun 27 '15 16:06 rickypc

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

SteveHarrison82 avatar Sep 28 '15 11:09 SteveHarrison82

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.

rickypc avatar Sep 29 '15 07:09 rickypc

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

SteveHarrison82 avatar Sep 29 '15 08:09 SteveHarrison82

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

zhehaoshi avatar Nov 02 '15 12:11 zhehaoshi

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.

rickypc avatar Nov 03 '15 03:11 rickypc

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?

emanlove avatar Nov 03 '15 11:11 emanlove

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 avatar Dec 28 '15 21:12 ernestm

@ernestm I have the same approach, as of now, have not got into issues

SteveHarrison82 avatar Mar 07 '16 08:03 SteveHarrison82

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.

aaltat avatar Feb 18 '17 19:02 aaltat