Description
Updates the Browsers collection.
Declaration
Browsers.Refresh()
| Result | None | |||
Applies To
The method is applied to the following object:
Result Value
None.
Remarks
The Browsers object initializes its collection of the available browsers when the test engine calls the object’s Count or Item property in script code for the first time, or when you launch a browser from your keyword test for the first time with the Navigate, Run Browser or other operation of the Web category.
The collection of browsers remains unchanged during the test run. If your tests uninstall or install browsers, the collection becomes outdated. To update the collection, call the Refresh method in the test that is run after a web browser is installed or uninstalled.
Example
The following code demonstrates calling the Refresh method in your script test:
JavaScript, JScript
// ...
// Test commands that uninstall or install a browser
// ...
// Update the collection, before working with browsers
Browsers.Refresh();
// Start another test
Browsers.Run(btIExplorer);
...
Python
# ...
# Test commands that uninstall or install a browser
# ...
# Update the collection, before working with browsers
Browsers.Refresh();
# Start another test
Browsers.Run[btIExplorer];
# ...
VBScript
' ...
' Test commands that uninstall or install a browser
' ...
' Update the collection, before working with browsers
Browsers.Refresh
' Start another test
Browsers.Run(btIExplorer)
...
DelphiScript
// ...
// Test commands that uninstall or install a browser
// ...
// Update the collection, before working with browsers
Browsers.Refresh();
// Start another test
Browsers.Run(btIExplorer);
...
C++Script, C#Script
// ...
// Test commands that uninstall or install a browser
// ...
// Update the collection, before working with browsers
Browsers["Refresh"]();
// Start another test
Browsers["Run"](btIExplorer);
...
