Python 对flash元素执行flash方法

Python 对flash元素执行flash方法,python,flash,selenium,Python,Flash,Selenium,我有一个flash编辑器,应该在我的自动测试中打开和关闭,但是flash当然有问题。我想做的是: def open_browser(self, profile): global driver, testcase, Ui # driver = webdriver.Firefox(profile) driver = webdriver.Remote( command_executor='http://127.0.0.1:4444/wd/hub',

我有一个flash编辑器,应该在我的自动测试中打开和关闭,但是flash当然有问题。我想做的是:

def open_browser(self, profile):
    global driver, testcase, Ui
    # driver = webdriver.Firefox(profile)
    driver = webdriver.Remote(
        command_executor='http://127.0.0.1:4444/wd/hub',
        desired_capabilities=DesiredCapabilities.FIREFOX)
    driver.maximize_window()
    driver.implicitly_wait(0.1)
    return driver


from com.thoughtworks.selenium.FlashSelenium import FlashSelenium
import unittest
import time
from selenium import webdriver

class SmokeTests(unittest.TestCase):
@classmethod
def setUpClass(cls):
    global driver, Ui, Base, UiNodes, MyFormsPage, actions, PmailPage, SharePage, FlashSelenium, flash
    Base = BaseTest()
    profile = webdriver.FirefoxProfile()
    # profile.set_preference('plugin.state.flash', 0)
    # profile.update_preferences()
    driver = Base.open_browser(profile)
    Ui = UiHelper(driver)
    UiNodes = link.UINodes()
    PmailPage = PmailPage(driver)
    SharePage = SharePage(driver)
    driver.get(config.Url.HOME)
    flash = FlashSelenium(driver, "pdfForms")

def test_flash(self):
    print "My flash test starts"
    Ui.wait_for_element(link.W9FormNodes.FILL_ONLINE_BIG, "BIG FILL ONLINE BUTTON!").click()
    time.sleep(10)
    print "sleep is over"
    print flash
    flash.call("close")
所以在这里,我在selenium网格上开始测试,打开我的链接,然后单击大按钮,我的flash编辑器打开。在那里,我把我的驱动程序和闪光框的id交给了FlashSelenium

<div id="flash-content" style="position:relative; z-index: 0;">
    <object id="pdfForms" width="100%" height="100%" align="middle" bottommargin="0" rightmargin="0" leftmargin="0" topmargin="0" codebase="https://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000">
        <param value="https://MY_TEST_ADDRESS.com/flash/wrapper2.swf?nocache=.20141202.102738" name="movie">
        <param value="sameDomain" name="allowScriptAccess">
        <param value="high" name="quality">
        <param value="#ffffff" name="bgcolor">
        <param value="type=editor&target_swf=https://MY_TEST_ADDRESS.com/flash/editor2.swf?ver=.20141208.074208&login_hash=T6k3fUBSgtqv1IDd4aBp&viewer_id=10970112&project_id=20077105&lang=en&path=https://MY_TEST_ADDRESS.com/flash/data&log_id=46042" name="FlashVars">
        <embed width="100%" height="100%" align="middle" pluginspage="https://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" flashvars="type=editor&target_swf=https://MY_TEST_ADDRESS.com/flash/editor2.swf?ver=.20141208.074208&login_hash=T6k3fUBSgtqv1IDd4aBp&viewer_id=10970112&project_id=20077105&lang=en&path=https://MY_TEST_ADDRESS.com/flash/data&log_id=46042" allowscriptaccess="sameDomain" name="pdfForms" bottommargin="0" rightmargin="0" leftmargin="0" topmargin="0" bgcolor="#ffffff" quality="high" src="https://MY_TEST_ADDRESS.com/flash/wrapper2.swf?nocache=.20141202.102738">

这有帮助吗:我看到了。但是在某些FlashSelenium方法中使用了_eval,我已经尝试将其更改为执行_脚本,但它没有任何帮助。也许我需要用某种特定的方式来改变它?我需要将flash.callclose更改为driver.execute\u script这里应该有什么?
Error
Traceback (most recent call last):
  File "/Users/mkurganskiy/Documents/Python/PDFfiller_Tests/tests/teeeeest.py", line 55, in test_flash
    flash.call("close")
  File "/Users/mkurganskiy/Documents/Python/PDFfiller_Tests/com/thoughtworks/selenium/FlashSelenium.py", line 43, in call
    self.flashJSStringPrefix = self.checkBrowserAndReturnJSPrefix()
  File "/Users/mkurganskiy/Documents/Python/PDFfiller_Tests/com/thoughtworks/selenium/FlashSelenium.py", line 133, in checkBrowserAndReturnJSPrefix
    appName = self.seleniumObj.get_eval("navigator.userAgent")
  AttributeError: 'WebDriver' object has no attribute 'get_eval'