Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/gwt/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Gwt 在selenium脚本中,无法获取focupanel和verticalpanel的dom ID_Gwt_Webdriver - Fatal编程技术网

Gwt 在selenium脚本中,无法获取focupanel和verticalpanel的dom ID

Gwt 在selenium脚本中,无法获取focupanel和verticalpanel的dom ID,gwt,webdriver,Gwt,Webdriver,我的问题是为下面的面板设置dom ID。我无法在selenium脚本中获取ID 我给FocusPanel和VerticalPanel的id focusPanel.ensureDebugId("focusPanel"); and also <inherits name="com.google.gwt.user.Debug"/> in gwt.xml file but it is not taking ids for these panels am no

我的问题是为下面的面板设置dom ID。我无法在selenium脚本中获取ID
我给FocusPanel和VerticalPanel的id

    focusPanel.ensureDebugId("focusPanel");
    and also
    <inherits name="com.google.gwt.user.Debug"/>  in gwt.xml file
    but it is not taking ids for these panels am not able get these panels in selenium script        


    org.openqa.selenium.NoSuchElementException: Unable to locate element: {"method":"id","selector":"focusPanel"}
    Command duration or timeout: 15.02 seconds
    For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html
    Build info: version: '2.37.0', revision: 'a7c61cbd68657e133ae96672cf995890bad2ee42', time: '2013-10-18 09:51:02'
    System info: host: 'INHYDRMOTURI2', ip: '10.91.115.72', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_21'
    Session ID: 76ec6eca-405c-47be-a5ba-7ea11d3ca515
    Driver info: org.openqa.selenium.firefox.FirefoxDriver
    Capabilities [{platform=XP, databaseEnabled=true, cssSelectorsEnabled=true, javascriptEnabled=true, acceptSslCerts=true, handlesAlerts=true, browserName=firefox, browserConnectionEnabled=true, nativeEvents=true, webStorageEnabled=true, rotatable=false, locationContextEnabled=true, applicationCacheEnabled=true, takesScreenshot=true, version=27.0.1}]

    can u suggest me how to set dom ids for verticalpanel and focuspanel
focusPanel.ensuredbugid(“focusPanel”);
而且
在gwt.xml文件中
但是它没有为这些面板获取ID,我无法在selenium脚本中获取这些面板
org.openqa.selenium.NoSuchElementException:无法定位元素:{“方法”:“id”,“选择器”:“focusPanel”}
命令持续时间或超时:15.02秒
有关此错误的文档,请访问:http://seleniumhq.org/exceptions/no_such_element.html
构建信息:版本:“2.37.0”,修订版:“a7c61cbd68657e133ae96672cf995890bad2ee42”,时间:“2013-10-18 09:51:02”
系统信息:主机:'INHYDRMOTURI2',ip:'10.91.115.72',os.name:'Windows 7',os.arch:'amd64',os.version:'6.1',java.version:'1.7.0_21'
会话ID:76ec6eca-405c-47be-a5ba-7ea11d3ca515
驱动程序信息:org.openqa.selenium.firefox.FirefoxDriver
功能[{platform=XP,databaseEnabled=true,cssSelectorsEnabled=true,javascriptEnabled=true,acceptSslCerts=true,handlesAlerts=true,browserName=firefox,browserConnectionEnabled=true,nativeEvents=true,webStorageEnabled=true,rotatable=false,locationContextEnabled=true,applicationCacheEnabled=true,takesscreensshot=true,version=27.0.1}]
你能建议我如何为verticalpanel和focuspanel设置dom ID吗

您是否尝试过设置ID

focusPanel.getElement().setId("focusPanel");
ensuredbugid()
的情况下,Id将变成
gwt debug-[your Id]

例如

focusPanel.ensureDebugId("focusPanel");

focusPanel
的id将是
gwt debug focusPanel

谢谢您的回复。我试过设置id gwt debug focusPanel,但它没有识别出给出相同异常的面板。您试过什么。请在设置ID的位置共享该行。您必须调用
focusPanel.getElement().setId(“focusPanel”)。移除
ensuredbugid()
call。首先,我尝试使用focusPanel.ensuredbugid(“focusPanel”);然后我尝试了focusPanel.getElement().setId(“focusPanel”);在selenium脚本driver.findElement(By.id(“focusPanel”))中单击();它正在给org.openqa.selenium.NoSuchElementException:无法定位元素:{“方法”:“id”,“选择器”:“focusPanel”}异常。并且在焦点面板的单击事件之前使用webdriverwait等待。直到(ExpectedConditions.visibilityOfElementLocated(By.id(“focusPanel”);Firefox中有firebug插件吗。首先尝试通过
document.getElementById(“focusPanel”)获取元素,如果它正常工作,那么
by.id(“focusPanel”)
会出现一些问题。我对selenium没有任何概念,但您也可以通过.id(“gwt debug focusPanel”)尝试