Giter Club home page Giter Club logo

robotframework-extendedselenium2library's Introduction

Hello, I'm Ricky ๐Ÿ‘‹

Ricky Huang - software engineer alongside a cartoon illustration of Ricky

I am a smart creative software engineer, who combines technical innovation, business strategy, and creativity, to make an impact on my employer's business objectives.

I am astute, have the will to learn, and have emergent leadership skills.

I thrive on ever-changing and challenging roles. I combine the focus on achieving goals with thoughtful analysis and judgment.

With over 25 years of enriched experiences and advanced academic background in Software Engineering, I help shape my employer's technology foundation to deliver their unique value proposition.

robotframework-extendedselenium2library's People

Contributors

isaacws avatar rickypc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

robotframework-extendedselenium2library's Issues

Confirm Action fails to find alerts

This is the case where I had to switch back to not-Extended S2L and as a result use both libraries in a single Test Suite which is highly inconvenient.

The code is as follows:

Choose Ok On Next Confirmation
Click Link  Delete
Confirm Action

The link is a simple bootstrap confirmable anchor:

<a href="/notifications/133" data-confirm="Are you sure &quot;name&quot;?" data-method="delete" rel="nofollow">Delete</a>

What I get with Extended S2L is:

  1. confirmation dialog opens,
  2. test fails with "There were no alerts".

What is expected (and happens upon changing the library to non-Extended):

  1. confirmation dialog opens,
  2. "Ok" is clicked inside the dialog.

I would be glad to look into it and try to provide a fix in case this issue becomes confirmed as a bug.

P.s. Other than this little issue the lib is great and has saved me tons of time. Thank you so much, @rickypc.

Message: angular.element(...).injector(...) is undefined

I am trying to a run a basic test and its failing.

command: pybot.bat --argumentfile c:\users\sasivana\appdata\local\temp\RIDEvrqxao.d\argfile.txt --listener C:\Python27\lib\site-packages\robotide\contrib\testrunner\TestRunnerAgent.py:54878:False C:\Users\sasivana\UIRefresh-12.0\j.robot

J

Test1 | FAIL |
WebDriverException: Message: angular.element(...).injector(...) is undefined
Stacktrace:
at anonymous (http://www.istockphoto.com/ line 69 > Function:1)

at handleEvaluateEvent (http://www.istockphoto.com/:69)

*** Settings ***
Library ExtendedSelenium2Library

*** Test Cases ***
Test1
Open Browser http://www.istockphoto.com/ firefox
Sleep 10
Close Browser
[Teardown] Close All Browsers

pip list
decorator (4.0.9)
docutils (0.12)
jenkinsapi (0.2.29)
pip (7.1.2)
pytz (2015.7)
requests (2.9.1)
robotframework (3.0)
robotframework-extendedselenium2library (0.8.1)
robotframework-ride (1.5.2.1)
robotframework-selenium2library (1.7.4)
selenium (2.52.0)
setuptools (19.1.1)
wheel (0.26.0)

Logging Failure

Click Element returns the following in the logs instead of the locator.

INFO : Clicking element '<selenium.webdriver.remote.webelement.WebElement (session="f6e2754a836005145dcb174a9b4eddc8", element="0.22097276127897203-5")>'.

Happening on v.0.7.0+

Confirm Action

Keyword Confirm Action fails to click on the action.
Can use Selenium2Library's Confirm Action and the keyword works properly

Happening on v.0.7.0+

Unable to use keywords in teardowns.

hi,

This is an amazing and very useful library.
I tried to play with the keywords and it seems that the keywords are not working when used in the
*** Settings *** section teardowns. Unfortunately, there is not error returned in logs.
Note: It works fine when used in teardowns under *** Test Cases *** section.

Attached is a sample log for the test i've ran.

Thanks.
image 1_new

"Multiple keywords with name xxx" error displayed in tear setup and tear down

The below error message is displayed, even though I imported ExtendedSelenium2Library. I also had uninstalled Selenium2Library

Multiple keywords with name 'Close All Browsers' found. Give the full name of the keyword you want to use:
ExtendedSelenium2Library.Close All Browsers
Selenium2Library.Close All Browsers

Kindly help

SeleniumLibrary & Python3 Support?

Will this library be updated so it can work with the new SeleniumLibrary (rather than the Selenium2Library==1.8.0) and Python3? Would just like to know if I will be able to move my tests over to Python3 as they are, or whether work will need to be done eventually... cheers.

Default locators are broken

Here is a button:

<button>My button</button>

With Selenium2Library you can click it like this

Click Button     My button

But the same code in ExtendedSelenium2Library it will timeout with an error instead.

This is because ExtendedSelenium2Library overrides click_button in such a way that instead of relying in the parent implementation of click_button in order to find the button, uses a new method (_scroll_into_view_on_internet_explorer), which never sets the tag= attribute in _element_find like the parent implementation does.

This does not affect prefixed locators (e.g. id=myButton).

What is _scroll_into_view_on_internet_explorer for?

Keyword: Get Browser Count broken

The keyword "Get Browser Count" returns all browsers in cache, no matter, if they are already closed.
So if you open 2 browsers and then close one browser, the return value of "Get Browser Count" is still 2.
Only "Close All Browser Windows" will reset the return value to 0.
Is this intentionally?

In the library file: browsercache.py, there would be the correct function "get_open_browsers". But this funtion is not published by robot framework.

Robot version: 3.0

Steps to reproduce:
Open Browser http://www.google.de chrome
Open Browser http://www.google.de chrome
Close Browser
Get Browser Count # actual return value is 2, expected 1

Importing error with Robot Ver 3.0.2

has this library depricated over time? i am currently trying to import it into my project, using robot framework version 3.0.2 and it is failing to import this library.

my thoughts is that its due to Selenium2Library moving everything under SeleniumLibrary in version 3.0.0 or its specifically something with robot framework 3.0.2.

if its due to an incompatibility with robot v3.0.2 are there plans to update this so that it is compatible? i would really rather not have to write my own locators to add to robot for angular testing.

Error:
[ ERROR ] Error in file 'C:\Workspace\Auto-Armor\comp.robot': Importing test library 'ExtendedSelenium2Library' failed: ImportError: cannot import name ElementKeywords
Traceback (most recent call last):
File "c:\python27\lib\site-packages\ExtendedSelenium2Library_init
.py", line 27, in
from ExtendedSelenium2Library.keywords import ExtendedElementKeywords
File "c:\python27\lib\site-packages\ExtendedSelenium2Library\keywords_init_.py", line 24, in
from ExtendedSelenium2Library.keywords.extendedelement import ExtendedElementKeywords
File "c:\python27\lib\site-packages\ExtendedSelenium2Library\keywords\extendedelement.py", line 27, in
from Selenium2Library.keywords import _ElementKeywords

Query: Is it a good practice to access, an event again on failure, as in snippet below

Hi Ricky,

I just want to understand, is it a good practice to use package as "retrying" and perform an action on failure as below

https://pypi.python.org/pypi/retrying

from retrying import retry

.
.
.


@retry(stop_max_attempt_number=3)
def click_button(self, locator, skip_ready=False):
    element = self._scroll_into_view_on_internet_explorer(locator)
    super(ExtendedSelenium2Library, self).click_button(element)
    if not skip_ready:
        self._wait_until_page_ready()

Still supported?

Trying to test some new apps written in angularJS with Robot Framework.
The biggest thing is identifying the buttons and some items that don't have a name or id set.

  1. I can't use the AngularJSLibrary if I don't have Selenium2Library

  2. Error when it gets to a $
    WebDriverException: Message: javascript error: $ is not defined
    JavaScript stack:
    ReferenceError: $ is not defined
    at eval (eval at executeAsyncScript (:439:5), :2:366)
    at Yf.k.notifyWhenNoOutstandingRequests /mwa/lib/angular/angular.min.js:46:344)
    at eval (eval at executeAsyncScript (:439:5), :2:323)
    at eval (eval at executeAsyncScript (:439:5), :2:439)
    at executeAsyncScript (:439:26)
    at apply.ELEMENT (:455:29)
    at callFunction (:347:33)
    at apply.ELEMENT (:357:23)
    at :358:3
    (Session info: chrome=58.0.3029.110)
    (Driver info: chromedriver=2.28.455520 (cc17746adff54984afff480136733114c6b3704b),platform=Windows NT 6.1.7601 SP1 x86_64)

It seems to actually be failing in our own Angular library? Not sure what that would cause Robot to stop?

input text keyword from ES2L library does not provide "skip_ready" functionality

When using E2SL library on non-angular page..Js error is seen
JavascriptException: Message: javascript error: $(...).trigger is not a function
JavaScript stack:
TypeError: $(...).trigger is not a function
at eval (eval at executeAsyncScript (:457:5), :2:372)
at sb.k.notifyWhenNoOutstandingRequests (https://appqa-4-07/vision/assets/scripts/vendor.min.js?_=jgbesc3j:1:25339)
at eval (eval at executeAsyncScript (:457:5), :2:323)
at eval (eval at executeAsyncScript (:457:5), :2:439)
at executeAsyncScript (:457:26)
at apply.ELEMENT (:473:29)
at callFunction (:361:33)
at apply.ELEMENT (:371:23)
at :372:3
(Session info: chrome=65.0.3325.181)
(Driver info: chromedriver=2.38.552522 (437e6fbedfa8762dec75e2c5b3ddb86763dc9dcb),platform=Linux 4.4.0-122-generic x86_64)

"Wait Until Page Does Not Contain Element" keyword is taking 15s to execute

Wait Until Page Does Not Contain Element is taking 15secs to execute when I use ExtendedSelenium2Library

Same Keyword is taking few milliseconds when I use Selenium2Library

Please find attached image for execution report.

Note:
I'm using
robotframework-extendedselenium2library==0.0.1
robotframework-selenium2library==1.7.4
issue

"input text" keyword failing in ES2L

Seeing following error when using ES2L library on non-angular JS page element JavascriptException: Message: javascript error: $(...).trigger is not a function
JavaScript stack:
TypeError: $(...).trigger is not a function
at eval (eval at executeAsyncScript (:453:5), :2:372)
at Va.p.notifyWhenNoOutstandingRequests (https://appqa-4-07/vision/assets/scripts/vendor.min.js?_=j631i2hg:1:20316)
at eval (eval at executeAsyncScript (:453:5), :2:323)
at eval (eval at executeAsyncScript (:453:5), :2:439)
at executeAsyncScript (:453:26)
at apply.ELEMENT (:469:29)
at callFunction (:361:33)
at apply.ELEMENT (:371:23)
at :372:3
(Session info: chrome=62.0.3202.94)
(Driver info: chromedriver=2.34.522913 (36222509aa6e819815938cbf2709b4849735537c),platform=Linux 4.4.0-103-generic x86_64)

and i cannot use "Input text" with skip_ready argument as per keyword documentation

WebDriverException: Message: unknown error: Cannot read property 'get' of undefined

This error message cause javaScript from init.py file which is located in NG_WRAPPER.

If you change content of NG_WRAPPER to this:

if(window.angular){
var inj;
try{
  inj=angular.element(document.querySelector('[data-ng-app],[ng-app],.ng-cope')||document).injector()
}
catch(ex){
};
if(!inj){
  inj=angular.injector(['ng'])
}
inj.get=inj.get||inj;
inj.get('$browser')
}

Then inj won't be anymore undifined. So you just should move (or remove, i don't know all casses)
* inj=angular.injector(['ng'])* from catch and put in IF. What should be in catch block - don't know.

(I won't create a MR because i'm not sure about catch)

After this fix, appears new problem and that is only in chrome (In ff everything is working fine with this change), it is about alert window. Tests will be executed like no error but log will show an error:

    UnexpectedAlertPresentException: Alert Text: None
Message: unexpected alert open: {Alert text : Are you sure?}
  (Session info: chrome=49.0.2623.87)
  (Driver info: chromedriver=2.21.371459 (36d3d07f660ff2bc1bf28a75d1cdabed0983e7c4),platform=Windows NT 6.3 x86_64)

The problem with alert i don't know how to fix it

Scroll Element Into View

Hi, I have following issue.
I have a page which contains a div.
Within this div there is a table and the surrounding div is scrollable.
The table is so big that some tr respectively the contained td are hidden (also the one which I want find)
So I tried "Scroll Element Into View" like this
...
Scroll Element Into View //td[contains(.,'SEARCHTEXTXXX')
...
Unfortunately it does not scroll the tr / td into view and even not find the td although its present if I scroll down the surrounding div.

How can I manage this to find the hidden tr?

Click Button id=XXX doesn't work anymore

Used to work with V0.7.2 but doesn't work anymore with V9.0: element id=XXX not found.
On Centos 6.8
kernel Linux 2.6-32-642.1.1.el6.i686
Jython 2.7.0
Firefox 38

See example below

| Setting | Value |
| Library | ExtendedSelenium2Library | 15

| Test Case | Action | Argument |
| My Test | [Documentation] | Example test |
| | Open Browser | http://www.google.fr
| | Input Text | id=lst-ib | pucerons rosiers
| | Click Button | id=sblsbb

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.