Suppose that you need to test on different web browsers: Internet Explorer, Mozilla Firefox and Google Chrome. You may find yourself asking two questions:
 

• Do I need different interface definitions for each of Internet Explorer, Firefox and Chrome?

Do I need to write different tests for each browser?

Solutions

1. If the web pages have similar titles, and controls inside the web pages have property values that are the same or similar in different browsers, you can avoid the need to create a different interface definition for each browser:

a. For windows (web pages),  capture the property doc title, because its value generally remains constant across browsers.

b. For controls, capture properties that have the same or similar values across browsers, and which can uniquely identify the controls.

2. Controls inside a given web page may have property values that vary from one browser to the next.  In some cases, wildcard characters (discussed later) may solve the problem. In others, you may find it too difficult to use a single interface to map all the controls you need in a way that will apply to all possible browsers. For these situations, TestArchitect supports Keyword variations and Systems & Platforms features to help users automate their tests across browsers.


1. Capturing one interface definition for all browsers


1.1. Capture a window (web page)


Ø Open a web page that you want to capture the interface of, so that it may be tested on browsers (e.g http://logigear.com.vn )

 



Ø Create a new interface entity in TestArchitect:

· Under the Interfaces subtree, right-click an interface node and then click New Interface Entity.



 

· Enter information for the interface:

+ Name: the interface name

+ Description: (Optional) short description for the interface

 


· Click Create. The new interface is added to the project under the selected interface node.

 

Ø Open the Interface Viewer (Press F7 or select Tools > Interface Viewer from the main menu; or click the Interface Viewer icon on the toolbar.) The Interface Viewer is launched.

Ø Capture the browser window using  TA property doc title.

 



1.2. Capture controls

Ø Identify control: there are 2 options:

      Option 1

§ Expand tree node

§ Select control

§ Select Turn on auto highlight on the toolbar to identify the control in the browser

 

       Option 2

§ Click Identify icon on the toolbar.

§ Move mouse to control that you want to identify on browser, and then click it

 



 Control will be shown on Interface Viewer’s tree.

                       


Ø Choose a property to capture with the control. You should choose a property-value pair that a), uniquely identifies the control, and b), does not vary in value either over time or across browsers. Typically, the properties name, id, or acc name are useful for identification.

Ø If property values are slightly different on different browsers, don’t worry. After you save the interface entity, you can use the wildcard ({.*}) to sufficiently “ambiguate” the difference.

       



Ø Map control

· Right-click the control to be mapped, and then select Rename.

· Type your choice of TA name for the item, and hit Enter. The control is now mapped.

 


Ø Save your settings to the interface entity by clicking Save on the toolbar.




2. Using keyword variations

Use keyword variations to create high-level actions or interface entities tailored to a given browser. To demonstrate this, we will perform the following steps:

· Create a high-level action

· Create keyword variations for the action

· Update the keyword variations

· Execute a test with variations


2.1. Create the high-level action

Create an action, name it config, and enter a single setting action line as follows:

               



This is your default version of config.


2.2. Create a keyword variation of the action

Ø Copy a definition (of an action, or interface entity) of which you wish to create a variation: In the TestArchitect explorer tree,

1. select the item and press Ctrl+C on your keyboard, or  

2. right-click the node and click Copy.

 



Ø Right-click a folder node where the variation is to reside and select Paste with Variations from the context menu.

 



Ø Select the Use keywords check box. In the text field, type the keyword(s) to be used to define this variation.



Ø The new variation appears as a node in the TestArchitect Explorer tree:

  



2.3. Update the action variation

Modify your action to match the requirements of its target browser.

In this case, the target browser is FireFox. To have TestArchitect launch a FireFox browser window, specify it in the setting / use browser action line.

 



2.4. Executing a test with a keyword variation


Ø Select test modules that you want to execute against the FireFox browser.

Ø Click the Execute button on the toolbar.

Ø In the Execute Test dialog box, type the keyword name (“firefox”) into the Keyword textbox, then  click Execute to start the test.

 



3. Using Systems & Platforms

The Systems & Platforms feature makes creating cross-browser tests easier. Supported browsers are Internet Explorer, Mozilla Firefox and Google Chrome. To do this we follow these steps:

· Create a platform and version

· Link each variation to a version

· Execute a test with variations


3.1. Create a platform

To execute your tests across multiple browsers types you must create a new platform and name it. For example, we’ll name ours “Browser”.

Ø Right-click the Systems & Platforms node, and then select New Systems or Platform. The New System dialog box appears.

Ø Enter details for the new platform:

· Name: The name of the new platform (“Browser”).

· Description: (optional) Short description of the platform.

Ø Click Create.

Ø The Browser platform is added as a node beneath the Systems & Platforms node.

 



3.2. Create a version


You can now create three version nodes for the Browser system and platform. The three new version nodes you will create are Internet Explorer, Mozilla Firefox and Google Chrome.

Ø Right-click the Browser node beneath the Systems & Platforms node, and then select Add Version.

Ø Enter the details for the new version:

· Name: the name of the new version, (e.g., “Internet Explorer”).

· Description: (optional) short description for the new version.

Ø Click Create. The new version Internet Explorer is added as a node beneath the Browser system node.

Ø Repeat the above steps to create the other two versions, Chrome and Firefox.

Ø The three new versions – Internet Explorer, Chrome, and Firefox – are added as nodes beneath the Browser platform node.



3.3. Link each variation to a version

Select the high-level action or interface entity for which you want to create a variation. The set of variations of a given item is used to execute cross-platform automation tests.

 

Example: You have a high-level action called config that is used to create essential initial configurations for the  browser. It is suggested that you have variations of the config action that set up web automation tests for each of Internet Explorer, Google Chrome, and Mozilla Firefox:

 

Ø In the TestArchitect explorer tree, navigate to the node for the config action you created earlier, right-click it, and then select Copy.

Ø Right-click the Actions node in the explorer tree, and select Paste with Variations. You have now created a variation for the config action.

Ø In the Variations dialog box, select the Link to version node check box.

Ø From the Select system drop-down list, select Browser.

Ø In the displayed system subtree under Browser, select Chrome to link this variation to Google Chrome.


Ø Click OKYour new config variation for Google Chrome appears as a node in the TestArchitect explorer tree.

Ø Repeat the above steps to create another variation linked to Mozilla Firefox 


Important: You now have three variations of the default config action, but their contents are all identical. Obviously, you must edit them (well, two of them), to get them to have different behaviors – that is, to ensure that each is tailored for its respective target browser.  That editing is fairly simple:

 


 

3.4. Executing a test with variation

In TestArchitect explorer, select the test modules that you want to execute across multiple browsers.

Ø Click the Execute button on the toolbar. The Execute Test dialog box appears.

Ø Execute the test modules.

· In the Execute Test dialog box, click the Select Version button in the Variation Specification frame. The Select Version dialog box appears.

· Select a browser.

§ Select the Internet Explorer check box to execute against Internet Explorer.

§ Select the Chrome check box to execute against Google Chrome.

§ Select the Firefox check box to execute against Mozilla Firefox.

· Click OK.

Ø On the Execute Test dialog box, click Execute to start the test.