机器人框架:等待页面加载超时

时间:2017-09-25 10:34:40

标签: robotframework

我们已经运行我们的Robot Framework环境将近一年没有任何问题,但现在我们收到错误消息:

index.html

可能有什么问题?我检查了磁盘空间,还剩下磁盘空间。

2 个答案:

答案 0 :(得分:0)

超时错误可能包含可能存在问题的清单。在平稳运行一年后加载页面会使其缩小一点,但仍有许多可能性。连接速度有时会发生变化,有时您加载的页面会添加一些功能,这些功能会导致加载时间更长或写得不好,因此加载速度很慢......您明白了。如果没有要查看的页面代码或代码,我只能建议两个修复程序。

首先,在Selenium2Library的代码中,有一个可以使用Set Selenium Timeout设置的超时变量。默认值为5秒,但如果您的页面加载时间较长,那么增加它可能会解决您的问题。这假设您的页面在手动测试中以合理的速率加载,并且打开它是您最不关心的问题。

其次,您可能正在测试AngularJS应用程序,而不是普通网站。如果这是真的,那么您将要使用ExtendedSelenium2Library,而不是Selenium2Library。 ExtendedSelenium2Library可以更好地处理AngularJS应用程序,并包含等待Angular应用程序加载的代码。

答案 1 :(得分:0)

旧的webdriver.xpi在页面加载处理方面存在很多错误。计时器未正确取消,导致随机的Windows切换和内存泄漏。我在这里复制一些可能对任何人有用的替换代码。

[ERROR,ContextLoader,localhost-startStop-1] Context initialization failed

org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from ServletContext resource [/WEB-INF/InEditWeb-servlet.xml]; nested exception is java.lang.IllegalStateException: Context namespace element 'component-scan' and its parser class [org.springframework.context.annotation.ComponentScanBeanDefinitionParser] are only available on JDK 1.5 and higher

at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:406)

at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:328)

at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:296)

at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)

at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)

at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)

at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124)

at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:92)

at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:123)

at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:423)

at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:353)

at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:254)

at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:198)

at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)

at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5128)

at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5653)

at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)

at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:1007)

at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:983)

at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:639)

at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1127)

at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:2019)

at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)

at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)

at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)

at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)

at java.base/java.lang.Thread.run(Thread.java:832)

Caused by: java.lang.IllegalStateException: Context namespace element 'component-scan' and its parser class [org.springframework.context.annotation.ComponentScanBeanDefinitionParser] are only available on JDK 1.5 and higher

at org.springframework.context.config.ContextNamespaceHandler$1.parse(ContextNamespaceHandler.java:65)

at org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:69)

at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1253)

at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1243)

at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:135)

at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:92)

at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:489)

at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:384)

... 26 more