-
Notifications
You must be signed in to change notification settings - Fork 763
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix alerts on chrome #661
Fix alerts on chrome #661
Conversation
In Chrome is often a random WebDriverException which caused by unknow reson. This commit creates a retry functionality that improves alert handling for Crome. Fixes #652
@@ -7,7 +8,9 @@ | |||
class _AlertKeywords(KeywordGroup): | |||
|
|||
def __init__(self): | |||
self._cancel_on_next_confirmation = False | |||
self._accept = 'accept' | |||
self._dismiss = 'dismiss' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these constants? If yes, they could be class variables and use capital letters:
class _AlertKeywords(...):
_ACCEPT = 'accept'
_DISMISS = 'dismiss'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in next commit
See my line notes. Otherwise looks good. |
Updated PR based on the comments |
Looks good to me. It might still be a good idea to rename |
Yeah, multi inheritance is... The |
The better architecture is a good idea. Hopefully it could be something that could be applied for other projects too. But as said, not in the 2.0 release. I generally don't like multi inheritance, because it makes stuff complicated in places where it should not be. Although there is a use case for multi inheritance but in my mind the inheritance line should not be tree, like in S2L, but it should be line like. Also the inheritance length should not be long. Maximum of two or three objects and I tend to favour only one in many cases. But that is totally different topic, I will make the changes later and let's see how code looks like. |
Updated PR based on comments. |
Yeah, I meant both I let you @aaltat decided what you want to do with the naming at this point. Feel also free to merge the PR when you consider it ready. |
Ah, I have forgotten, again, what Only thing with the change is that because alerts are brokenen again, should we create a 1.8.1 release and cherry pick this commit on top of the 1.8.0 tag. Of course it will create a smallish mess for everyone history... Perhaps if none reports a problem we could wait for the 2.0.0 release. |
On 09/14/2016 10:45 AM, Tatu Aalto wrote:
Not sure I see the need to do anything that screws with the history Ed |
Messing up history isn't a good idea, but creating a separate 1.8-maintenance branch ought to be OK.If this isn't urgent, we can simply wait for 2.0 too. |
Only person, who I know, that has complained on the problem is one of my colleagues. And for him I made workaround. If none else complain we can wait until 2.0.0. |
* Improves alert hadling for Chrome (robotframework#652) In Chrome is often a random WebDriverException which caused by unknow reson. This commit creates a retry functionality that improves alert handling for Crome. Fixes robotframework#652 * Refactored the code to simplify the logic * Changed class attribute to better describe what it does * Updates alert handling based on the comment review * Changed class atributes names to describe better what they do * Fixed based on the comments
* Improves alert hadling for Chrome (robotframework#652) In Chrome is often a random WebDriverException which caused by unknow reson. This commit creates a retry functionality that improves alert handling for Crome. Fixes robotframework#652 * Refactored the code to simplify the logic * Changed class attribute to better describe what it does * Updates alert handling based on the comment review * Changed class atributes names to describe better what they do * Fixed based on the comments
When running acceptance test with chrome, it seems that selenium quite often fails on:
alert.text
oralert.dismiss
executions with WebDriverException indicating error on JavaScript execution. This commit simplifies the alert handling and creates a re-try logic if selenium raises WebDriverException when performing actions on alerts.