2011-11-03 112 views
0

我简单的需求:多硒端口本地主机问题

我想在两个不同的硒端口打开两个IE浏览器在本地主机上

我的设置

我的硒服务器设置

在Win 7上运行的端口4444和4445上的Selenium服务器(2.2.0v)

我的硒客户端安装

硒客户端 - 硒RC上的Python 2.7相同的Win 7,其中硒服务器运行

我只开启两个不同的硒端口两个浏览器的代码是在这里:

# C:\Python27\python.exe 
from selenium import selenium 
def localhost_issue(): 
    ''' 
    This method will simply open two IE browsers on two different Selenium 
    ports on localhost 

    This FAILS to happens because only one browser opens at the end 

    ''' 
    myserver = 'localhost' 

    s1 = selenium(myserver, 4444, '*iexplore', 'http://www.google.com/') 
    s1.start() 
    s1.open('/') 

    s2 = selenium(myserver, 4445, '*iexplore', 'http://www.msn.com/') 
    s2.start() 
    s2.open('/') # FAILS BECAUSE browser 1 is overwritten by browser 2 
localhost_issue() 

这种情况只发生在IE浏览器(不是firefox)上。任何帮助?

感谢, 阿米特

回答

0

我不喜欢做一个坏消息,但是这是因为Firefox的工作下的配置文件,但IE是一个不同的野兽,尽管这适用于硒电网绝对适用于您的问题,以及:http://svn.openqa.org/fisheye/browse/~raw,r=390/selenium-grid/website/src/main/webapp/faq.html#i_get_some_strange_errors_when_i_run_multiple_internet_explorer_instances_on_the_same_machine

+0

太好了。谢谢您的帮助。我注意到,这个问题只在一个本地主机上使用Selenium服务器和客户端时才会出现!当我的服务器(端口4444和4445)是客户端在不同的机器上时,我不会遇到这个问题。 – abarik

+0

当然,因为他们在不同的机器 –

+0

有没有提出这个问题?你想让我为此提出一个问题吗? – abarik