Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(627)

Side by Side Diff: chrome/test/functional/execute_javascript.py

Issue 3012039: Add ExecuteJavascript() method to PyUITestBase (Closed)
Patch Set: merge to head Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/test/pyautolib/pyauto.py » ('j') | chrome/test/pyautolib/pyauto.py » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #!/usr/bin/python
2 # Copyright (c) 2010 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
5
6 import os
7 import sys
8 import unittest
9
10 import pyauto_functional
11 from pyauto import PyUITest
12
13
14 class ExecuteJavascriptTest(PyUITest):
15
16 def testExecuteJavascript(self):
17 path = os.path.join(self.DataDir(), "frame_dom_access",
18 "frame_dom_access.html")
19
20 # FIXME: I'm not sure if this path will work on windows.
21 self.NavigateToURL("file://%s" % path)
22
23 v = self.ExecuteJavascript("window.domAutomationController.send(" +
24 "document.getElementById('myinput').nodeName)")
25 self.assertEqual(v, "INPUT")
26
27 def testGetDOMValue(self):
28 path = os.path.join(self.DataDir(), "frame_dom_access",
29 "frame_dom_access.html")
30
31 # FIXME: I'm not sure if this path will work on windows.
32 self.NavigateToURL("file://%s" % path)
33
34 v = self.GetDOMValue("document.getElementById('myinput').nodeName")
35 self.assertEqual(v, "INPUT")
36
37
38 if __name__ == '__main__':
39 pyauto_functional.Main()
OLDNEW
« no previous file with comments | « no previous file | chrome/test/pyautolib/pyauto.py » ('j') | chrome/test/pyautolib/pyauto.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698