51Testing软件测试论坛

 找回密码
 (注-册)加入51Testing

QQ登录

只需一步,快速开始

微信登录,快人一步

查看: 7559|回复: 5
打印 上一主题 下一主题

selenium rc 在IE下运行的问题!急!急!!急!!!

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2010-9-27 12:04:25 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
我键入命令 java -jar selenium-server.jar -htmlSuite "*iexplore" "http://192.168.1.149:8080/mail/" "E:\auto.html" "E:\results_jwj.html"

可是 在selenium 自启动 浏览器时 报错如下:

HTML suite exception seen:
java.lang.RuntimeException: sessionId 467215 doesn't exist ; perhaps this session was already stopped?

这个 sessionId 467215 是随机的 , 它到底是怎么来的?
为什么使用 Firefox 没有这个问题?
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

该用户从未签到

2#
发表于 2010-9-27 19:48:27 | 只看该作者
猜测是原ie进程没有结束,在任务管理器看看有没有,杀掉,或者注销。还不行就是另外原因了
回复 支持 反对

使用道具 举报

该用户从未签到

3#
 楼主| 发表于 2010-9-28 09:14:05 | 只看该作者
问题已经解决。
这是selenium-rc 1.0.2和1.0.3存在的共性bug,目前bug已解决。

解决方案如下:

I look into the source and the bug was introduce by the SVN revision

    * Revision 7188
    * Date 01/09/2009
    * Author: hbchai
    * Comment: Improve setExtensionJs() for HTA mode.
    * Modified files:
      /selenium-rc/trunk/server-coreless/src/main/java/org/openqa/selenium/server/browserlaunchers/HTABrowserLauncher.java

Diff
Index: HTABrowserLauncher.java
===================================================================
— HTABrowserLauncher.java (revision 7187)
+++ HTABrowserLauncher.java (revision 7188)
@@ -4,19 +4,22 @@
*/
package org.openqa.selenium.server.browserlaunchers;

-import java.io.*;
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;

import org.apache.commons.logging.Log;
-import org.apache.tools.ant.util.*;
+import org.apache.tools.ant.util.FileUtils;
import org.mortbay.log.LogFactory;
import org.openqa.selenium.server.BrowserConfigurationOptions;
+import org.openqa.selenium.server.FrameGroupCommandQueueSet;
import org.openqa.selenium.server.RemoteControlConfiguration;
import org.openqa.selenium.server.browserlaunchers.locators.InternetExplorerLocator;

//EB - Why doesn't this class extend AbstractBrowserLauncher
//DGF - because it would override every method of ABL.
public class HTABrowserLauncher implements BrowserLauncher { - static Log log = LogFactory.getLog(HTABrowserLauncher.class); private String sessionId; private File dir; @@ -96,13 +99,36 @@ }
f.copyFile(selRunnerSrc, selRunnerDest);
f.copyFile(testRunnerSrc, testRunnerDest);
+ writeSessionExtensionJs(coreDir);
} catch (IOException e) { throw new RuntimeException(e); }
+ }
+
+ /**
+ * Writes the session extension javascript to the custom profile directory.
+ * The request for it does not pass through the Selenium server in HTA
+ * mode, thus the specialized extension js resource handler is of no use.
+ *
+ * @param coreDir
+ * @throws IOException
+ */
+ private void writeSessionExtensionJs(File coreDir) throws IOException {
+ FrameGroupCommandQueueSet queueSet =
+ FrameGroupCommandQueueSet.getQueueSet(sessionId);

    *

      + if (queueSet.getExtensionJs().length() > 0) { + String path = "scripts/user-extensions.js[" + sessionId + "]"; + FileWriter fileWriter = new FileWriter(new File(coreDir, path)); + BufferedWriter writer = new BufferedWriter(fileWriter); + + writer.write(queueSet.getExtensionJs()); + writer.close(); + + fileWriter.close(); + }
      }
      -
      +
      public void close() {
      if (browserOptions.is("killProcessesByName")) {
      WindowsUtils.tryToKillByName("iexplore.exe");

-----嘿嘿 ,把带加号的删去.然后再编译一下,替换掉selenium-server.jar包中的一个HTABrowserLauncher.class类就可以.
回复 支持 反对

使用道具 举报

该用户从未签到

4#
发表于 2010-9-28 09:35:47 | 只看该作者
回复 支持 反对

使用道具 举报

该用户从未签到

5#
发表于 2011-2-15 18:07:52 | 只看该作者
这个问题都能找出来,你太强了,佩服
回复 支持 反对

使用道具 举报

该用户从未签到

6#
发表于 2011-2-16 16:46:26 | 只看该作者
这个牛~~
回复 支持 反对

使用道具 举报

本版积分规则

关闭

站长推荐上一条 /1 下一条

小黑屋|手机版|Archiver|51Testing软件测试网 ( 沪ICP备05003035号 关于我们

GMT+8, 2024-4-28 04:22 , Processed in 0.066856 second(s), 27 queries .

Powered by Discuz! X3.2

© 2001-2024 Comsenz Inc.

快速回复 返回顶部 返回列表