Quantcast
Channel:
Viewing all articles
Browse latest Browse all 43798

Wiki Page: Are there any examples of how SilkTest can use functions within tags?

$
0
0
An example is in the ShowBorderlessTables Browser option when using the DOM extension. Normally, if a particular table cannot be recognised, the Browser option (0 to 1.0) can be adjusted until the table is recognised. Consider a test script that needs to access an object in a table (when ShowBorderlessTables is at 1.0) and then readjust the SetBorderlessTables option back to 0.5 in order to continue the test script. Example: Browser.SetUserOption ("ShowBorderlessTables", 1.0, USEROPT_DEFAULT) Print (HomePage.MyTable.Exists ()) // NOTE : 0.5 is the default Browser.SetUserOption ("ShowBorderlessTables", .5, USEROPT_DEFAULT) Print (HomePage.Exists ()) The problem is that the script is not as legible with SetUserOption occurring in multiple places. Also, it would be difficult to remember that this adjustment needed to occur when writing the script. By using tags with embedded functions, a resolution may resemble the example below ; Using this technique, a tester would be able to adjust the ShowBorderlessTables value at run time. Now each HtmlTable2 object has the ability to describe its own BORDER setting. Using this technique, the script would look like : Print (HomePage.MyTable.Exists ()) Print (HomePage.Exists ()) Notice that the ShowBorderlessTables settings have been removed. To verify that this worked : Print (Browser.GetUserOption ("ShowBorderlessTables", USEROPT_DEFAULT)) // prints 0.5 Print (HomePage.MyTable.Exists ()) // prints TRUE Print (Browser.GetUserOption ("ShowBorderlessTables", USEROPT_DEFAULT)) // prints 1.0 Print (HomePage.Exists ()) // prints TRUE Print (Browser.GetUserOption ("ShowBorderlessTables", USEROPT_DEFAULT)) // prints 0.5 Remember that the idea is to determine the tag so that the application can be referenced. The idea is NOT to reference the application so that a tag can be determined. In other words, a tester will not be able to reference anything about another object in the tag function. Only that which is internal to the automation architecture and outside the application may be referenced.

Viewing all articles
Browse latest Browse all 43798

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>