Skip to content

updated '_waiting.py' file - #288

Closed
anilreddy wants to merge 4 commits into
robotframework:masterfrom
anilreddy:master
Closed

anilreddy wants to merge 4 commits into
robotframework:masterfrom
anilreddy:master

Conversation

@anilreddy

Copy link
Copy Markdown

added wait until element is not visible keyword will add acceptance test soon
added a highlight element keyword and test for it

image

added a wait until element is not visible keyword
Added a Highlight Element Keyword which highlights elements
added test for Keyword Highlight Element
@anilreddy

Copy link
Copy Markdown
Author

added a highlight element keyword and test

updated Selenium2Library.html with new keywords
@just-be-dev

Copy link
Copy Markdown
Contributor

Before we can do anything with a PR it needs to have working tests and be passing the Travis build.

Secondly, changes should be broken up into logical changes. These two keywords seem unrelated and it doesn't seem like they should be lumped into the same PR.

@just-be-dev just-be-dev closed this May 6, 2015
@anilreddy

Copy link
Copy Markdown
Author

Hi @zephraph First of all build failure is not due to these changes and for the highlight element keyword I have added a test case. As recently 'Wait Until Element Not Visible' has been added. Just merge the 'Highlight Element' keyword. Please let me know if I need to do anything.

@just-be-dev

Copy link
Copy Markdown
Contributor

I think the failure is just because your PR is out of date. (For more information how you can update your fork, see this article).

As far as your highlight element keyword goes, I'm not sure that it adds enough substantial value to the library to be added. The reason I say that is that it's somewhat of a niche functionality that might not be useful in all cases. What about when there's a yellow background?

With that being said, I do want to help facilitate this functionality. It seems to me that to get this functionality we need two things: to be able to call Execute Javascript with arguments and to be able to get a WebElement just using a locator. Execute Javascript with args has been discussed in #323 but we haven't come up with a solution yet. I'll try to revive that conversation. As for getting webelements, that's coming soon! See #356.

As a temporary solution I would simple suggest using Execute Javascript and locating the element manually with javascript.

@just-be-dev

Copy link
Copy Markdown
Contributor

Hey @anilreddy, just as a follow up, I am trying to make progress on the things I discussed yesterday.

I created a PR (#387) to address using arguments with Execute Javascript. If that PR and #356 gets merged in you'll be able to implement the same functionality in your PR like this....

*** Keywords ***
Highlight Element
    [Arguments]    ${locator}
    ${element}=    Get WebElement    ${locator}
    Execute Javascript   ${element}
    ...   element = arguments[0];
    ...   original_style = element.getAttribute('style');
    ...   element.setAttribute('style', original_style + "; background: yellow;");
    ...   setTimeout(function(){
    ...        element.setAttribute('style', original_style);
    ...   }, 300);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants