Releases: jlstewart379/rufus
Enchanced caching
This version released Jan. 8, 2014 includes a mechanism to cache the page source between page object loads. Previously, elements would ask Selenium for the page source each time those elements were accessed. Now, if the page object has not changed since an element from the same page object was requested the element gets it's result from the cached page source instead of asking selenium to generate a new one.
Also added a custom waiter that refreshes the page source data between iterations. The Rufus::Waiter object accepts the Rufus::Driver and options for timeout and search interval. The until instance method takes a block. The options are optional. The default timeout is 5 seconds, the default search interval is 0.2 second.
Example usage of Rufus::Waiter
driver = Rufus::Driver.new
wait = Rufus::Waiter.new driver, :timeout => 5, :interval => 1
wait.until{view.enabled?}The above code creates a new Rufus::Waiter object which will wait for five seconds for view.enabled? to evaluate to true. After five seconds the result will return false. The wait object checks the view's enabled? status every one second … this is the interval parameter.
rufus v0.8.1
This version, released on Dec. 10, 2013, adds a flag to the config.yml which indicates how to do a lookup on some read-only elements of a view.
config.yml has a new value it can read
optimized: trueWith this value set to true, rufus asks selenium for the current page source and then parses the return value for the needed information. When this value is set to false, rufus asks Selenium to find an element using find_element(:key, 'value'). The returned element is then asked for information.
Example: Consider getting whether or not a view is visible.
Optimized
- Ask selenium for page source
- Parse page source
- Look for the element in the page source and check the value for its "visible" property.
Non-optimized
- Ask selenium to find the needed element using find_element(:key, 'value')
- If the call to find_element returns an element, e, call e.displayed? to get the value for the visible property.
It seems that parsing the page source for the needed data is faster than the call to find_elements. The RufusApp automated tests took a little over 30 minutes to run with the optimized flag set to false. The same suite of of tests took a little over 21 minutes to run with the optimized flag set to true.
Currently the optimized calls are for some read-only elements of a view. So calls to exists?, displayed?, enabled? and class can be discovered in an optimized fashion.
rufus v0.7
Added extra support for table accessors. Define a table accessor:
table(:table, :name => 'tableName')Click on a table by index:
table_view.click_on 2Click on a table by child label:
table_view.click_on 'Child Element Label'Take a screenshot:
driver = Rufus::Driver.new
driver.screenshot 'fileName.png'