Tuesday 23 December 2014

Python Web Testing

Web testing using module webbrowser

Usage Examples:

webbrowser.open_new(url)
    Open url in a new window of the default browser, if possible, otherwise,
    open url in the only browser window.

Example: webbrowser.open_new('http://google.com')

webbrowser.open_new_tab(url)
    Open url in a new page (“tab”) of the default browser, if possible, 
    otherwise equivalent to open_new().


Search for something in Google
Opens new window in default browser.

import webbrowser
#
google = input('Google search: ')

webbrowser.open_new_tab('http://www.google.com/search?btnG=1&q=%s' % google)


Another Web Testing tutorials

Follow the link below:

No comments:

Post a Comment