robotframework / OldSeleniumLibrary

Deprecated Selenium library for Robot Framework
Apache License 2.0
13 stars 3 forks source link

dont_wait= not being accepted #130

Closed spooning closed 9 years ago

spooning commented 9 years ago

Originally submitted to Google Code by jerry57 on 2 Aug 2010

RobotFramework 2.5.1 RobotFramework-SeleniumLibrary 2.4

When I tried to run some test suites after upgrading I found that several were timing out. After looking at the debug log, I found that "Click Element" was ignoring the "dont_wait=" argument. If I change it to "dont_wait" the test continues on. I checked the documentation for the SeleniumLibrary and shows that "dont_wait=" should be the argument though. Is this being change for some reason to "dont_wait"?

spooning commented 9 years ago

Originally submitted to Google Code by jerry57 on 2 Aug 2010

This is what is seen in the debug.log

+-- START KW: SeleniumLibrary.Click Element [ xpath=//dt[@⁠id='iplantc-mydata-sho rtcut']/a/div[1]/img | dont_wait= ] Clicking element 'xpath=//dt[@⁠id='iplantc-mydata-shortcut']/a/div[1]/img'. Parsed locator 'xpath=//dt[@⁠id='iplantc-mydata-shortcut']/a/div[1]/img' to searc h expression 'xpath=//dt[@⁠id='iplantc-mydata-shortcut']/a/div[1]/img' Timed out after 30000.0ms

spooning commented 9 years ago

Originally submitted to Google Code by jerry57 on 2 Aug 2010

Just saw Issue 127 about type in the docs. Does this mean that dont_wait= needs to have something set like dont_wait=0 or a numeric for number of seconds to wait?

spooning commented 9 years ago

Originally submitted to Google Code by @pekkaklarck on 3 Aug 2010

If a keyword has optional dont_wait argument and you don't want the keyword to wait for page to load, you just need to use any non-empty value with this argument. When you used dont_wait= in Robot Framework versions prior to 2.5, you gave that exact literal string as an argument. You would have got the same effect if, instead, you would have string and don't wait page to load or just foobar there instead.

Robot Framework 2.5 introduced new named argument syntax [1], and now dont_wait= happens to match that. The actual argument passed to the keyword by the framework is what you have after the equal sign. In this case that value happens to be an empty string which is not what you want. In this case there's no real need to use the named argument syntax, or specify the argument name for other reasons, so replacing dont_wait= with more easy to read text like don't wait for page to load is probably the best solution for you. That also works with all RF versions.

[1] http://robotframework.googlecode.com/svn/tags/robotframework-2.5.1/doc/userguide/RobotFrameworkUserGuide.html#named-arguments