-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.api_diff
53 lines (45 loc) · 1.98 KB
/
README.api_diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
API Comparisons
This package allows easy comparison between accessibility APIs that
are exposed by two different user agents. Comparisons could be made
both for the static accessible tree, and event sequences generated by
a Selenium interaction script.
Comparing Accessible Trees
==========================
Complex trees could be compared using the quick_diff.py tool. This is
a typical use (don't forget to edit settings.ini).
./quick_diff.py -o viewdiff/ff3_vs_ie3.xml \
-B WindowsFirefox3 \
-B WindowsInternetExplorer \
http://google.com
It is important the output go in viewdiff/ because that is where all
of the complimentary XSLT, Javascript and CSS files are. To view the
two trees, and the comparison, point Firefox out the outputted file.
Comparing Event Sequences
=========================
The extended Python Selenium client (SpecleniumClient), requires a few
tweaks for retrieving a list of events. You could use the Selenium IDE
Firefox extension fo recording a proper script. Save it as a Python
unit test. The following script highlights the changes needed.
# Changed import line to import the Speclenium client instead of
# the standard Selenium one.
from speclenium_client import SpecleniumClient as selenium
import unittest, time, re
class NewTest(unittest.TestCase):
def setUp(self):
self.verificationErrors = []
self.selenium = selenium("localhost", 4444, "*chrome", "http://change-this-to-the-site-you-are-testing/")
# Set record_events to True.
self.selenium.start(record_events=True)
def test_new(self):
sel = self.selenium
sel.open("/")
sel.type("q", "aria")
sel.click("submit")
sel.wait_for_page_to_load("30000")
def tearDown(self):
# Dump events to stdout.
print '\n'.join(self.selenium.get_stored_events())
self.selenium.stop()
self.assertEqual([], self.verificationErrors)
if __name__ == "__main__":
unittest.main()