rich inadvanced web browser automation

20
Automating and Testing Feature-Rich Web Pages

Upload: mathias-roth

Post on 04-Jun-2015

1.615 views

Category:

Technology


1 download

DESCRIPTION

Advanced Web Browser Automation

TRANSCRIPT

Page 1: Rich InAdvanced Web Browser Automation

Automating and TestingFeature-Rich Web Pages

Page 2: Rich InAdvanced Web Browser Automation

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.

Page 3: Rich InAdvanced Web Browser Automation

Frames

Page 4: Rich InAdvanced Web Browser Automation

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:

Page 5: Rich InAdvanced Web Browser Automation

Demo

iOpus Test

http://www.iopus.com/iim/demo/v6/frames/

Real World Example

Frames: www.orbitz.com

Page 6: Rich InAdvanced Web Browser Automation

Popups (More than one web page open at the same time)

Page 7: Rich InAdvanced Web Browser Automation

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

Page 8: Rich InAdvanced Web Browser Automation

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)

Page 9: Rich InAdvanced Web Browser Automation

Dialogs

Page 10: Rich InAdvanced Web Browser Automation

Dialog examples

Page 11: Rich InAdvanced Web Browser Automation

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

Page 12: Rich InAdvanced Web Browser Automation

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.

Page 13: Rich InAdvanced Web Browser Automation

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

Page 14: Rich InAdvanced Web Browser Automation

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"

Page 15: Rich InAdvanced Web Browser Automation

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

Page 16: Rich InAdvanced Web Browser Automation

Certificate Dialog

ONCERTIFICATEDIALOG C=<x>

Some secure web pages ask you to select a client side certificate.

Page 17: Rich InAdvanced Web Browser Automation

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

Page 18: Rich InAdvanced Web Browser Automation

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.

Page 19: Rich InAdvanced Web Browser Automation

Web Page Dialog Recording Screenshot

Page 20: Rich InAdvanced Web Browser Automation

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