MuraliKola / robotframework-seleniumlibrary

Automatically exported from code.google.com/p/robotframework-seleniumlibrary
Apache License 2.0
1 stars 0 forks source link

dont_wait= not being accepted #130

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
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"?

Original issue reported on code.google.com by jerry57@gmail.com on 2 Aug 2010 at 5:24

GoogleCodeExporter commented 8 years ago
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

Original comment by jerry57@gmail.com on 2 Aug 2010 at 5:27

GoogleCodeExporter commented 8 years ago
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?

Original comment by jerry57@gmail.com on 2 Aug 2010 at 5:59

GoogleCodeExporter commented 8 years ago
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

Original comment by pekka.klarck on 3 Aug 2010 at 10:00