rich inadvanced web browser automation
Post on 04-Jun-2015
1.615 Views
Preview:
DESCRIPTION
TRANSCRIPT
Automating and TestingFeature-Rich Web Pages
Automating Web Pages
Frames Multiple Browser Windows („Popups“) Dialog boxes of all kinds
Many web pages contain elements to help them organize their content better. These elements have in common that they are an additional challenge to web page automation.
Frames
Frames
FRAME F=<x>
Number <x> depends on the position of the frame in the object tree of website
FRAME F=0 is used for the frame page itself or when switching to a website without frames
Internet Macros recognizes frames automatically:
Demo
iOpus Test
http://www.iopus.com/iim/demo/v6/frames/
Real World Example
Frames: www.orbitz.com
Popups (More than one web page open at the same time)
Popups
Internet Macros handles frames automatically
TAB T=<x> command Number depends on the position of the window in the tab order.
This might depend on history
Related commands are
TAB OPEN TAB CLOSE TAB CLOSEALLOTHER
Demo
iOpus Test Page
http://www.iopus.com/iim/demo/v6/popup/
Real World Example
http://www.fool.com/calcs/calculators.htm (Opens calculator in second page)
Dialogs
Dialog examples
Javascript Dialogs
ONDIALOG POS=<x> BUTTON=… CONTENT=…
POS is used when many dialogs occur directly after each other. Specify a specific decision for each dialog (POS=1 is first dialog, POS=2 is second dialog.)
CONTENT is used to fill out a Javascript PROMPT dialog.
Extract the text of a dialog with SET !EXTRACTDIALOG YES
Login Dialog
ONLOGIN USER=username PASSWORD=password
The password is stored with the method you selected on the SECURITY tab of the options dialog. More details about the different password storage options later.
Download Dialog
ONDOWNLOAD FOLDER=* FILE=+_{{yyyyymmdd_hhnnss}}
The general web page timeout also applies to downloads. If needed, you can also increase the timeout value inside the macro with SET !TIMEOUT
Download File Settings
FOLDER Settings:
Empty or ("*") => default folder or the absolute path to a folder,
FILE Settings:
Example: You want to download a file with the file name "stockreport.pdf"
If you use "FILE=*" you get "stockreport.pdf"
If you use "FILE=Intel" you get "Intel.pdf" (the original file extension is always preserved)
If you use "FILE=+Intel" you get "stockreportIntel.pdf" ("+" means, that the text is appended to the original file name)
If you use "FILE=+_{{!NOW:YYYYMMDD_hhmmss}}" you get "stockreport_20040525_141030.pdf"
Security Dialog
ONSECURITYDIALOG BUTTON=YES CONTINUE=YES
While testing web sites, you may want the macro to stop and report the security dialog to you. In this case, please use CONTINUE=NO
Certificate Dialog
ONCERTIFICATEDIALOG C=<x>
Some secure web pages ask you to select a client side certificate.
Error Dialog
ONERRORDIALOG BUTTON=YES CONTINUE=YES
While testing web sites, you may want the macro to stop and report the security dialog to you. In this case, please use CONTINUE=NO
Web Page Dialog
ONWEBPAGEDIALOG KEYS=Hello{ENTER}{CLOSE}
Since web page dialogs can contain any number of buttons or boxes, this dialog is automated by sending a specific list to keyboard commands to them. Internet Macros has a wizard for testing the command.
Web page dialogs are similar to standard JavaScript dialogs, but display HTML content instead.
Web Page Dialog Recording Screenshot
Demo
iOpus Test Pages:
http://www.iopus.com/iim/demo/v6/dialogs/javascript.htm http://www.iopus.com/iim/demo/v6/dialogs/html/
Real world examples:
Security dialog: https://forum.raidenftpd.com/showflat.php?Board=general&Number=40306
Certificate: https://direct.bankofamerica.com Dialogs: http://www.javascriptkit.com/javatutors/alert2.shtml
top related