5

Selenium không thể khởi chạy IE.Selenium không thể khởi chạy IE.

10:56:25,005 INFO [org.openqa.selenium.server.SeleniumDriverResourceHandler] Command request: getNewBrowserSession[*iexploreproxy, http://192.168.132.105:8080/, ] on session null 10:56:25,005 INFO [org.openqa.selenium.server.BrowserSessionFactory] creating new remote session 10:56:25,005 INFO [org.openqa.selenium.server.BrowserSessionFactory] Allocated session 9fa93fe865904e3da895c91a86ebdcb0 for http://192.168.132.105:8080/, launching... 10:56:25,005 INFO [org.openqa.selenium.server.browserlaunchers.WindowsProxyManager] Modifying registry settings... 10:56:25,474 INFO [org.openqa.selenium.server.browserlaunchers.InternetExplorerCustomProxyLauncher] Launching Internet Explorer...

Sau Internet Explorer... nó sẽ không trả lời. Xin hãy giúp tôi trong việc khắc phục vấn đề này.

Trả lời

19

Bạn bắt đầu trung tâm và nút như thế nào?

Đối với các nút, điều này đã làm việc cho tôi:

  1. Tải InternetExplorerDriver từ http://code.google.com/p/selenium/downloads/list đến c: \ Selenium
  2. Tải Selenium đứng một mình máy chủ (selen-server-độc-2.20.0.jar) từ http://code.google.com/p/selenium/downloads/list vào c: \ Selenium
  3. Bắt đầu nút: java -jar selenium-server-standalone-2.20.0.jar -role webdriver -hub http://192.168.1.248:4444/grid/register -browser browserName="internet explorer",version=8.0,platform=WINDOWS -Dwebdriver.internetexplorer.driver=c:\Selenium\InternetExplorerDriver.exe

tôi đang sử dụng OSX để chạy các trung tâm, Virtual Box để chạy Windows 7 Home và trung tâm IE.

Ngoài ra, hãy đảm bảo rằng cài đặt Chế độ được bảo vệ giống nhau cho tất cả các vùng.

+0

Bạn có cần trình điều khiển trình khám phá internet cho thử nghiệm lưới selen không? Tôi có thể chạy thử nghiệm của tôi trong IE mà không có nó (sử dụng selenium webdriver, grid 2) – JCarter

+0

đang tìm kiếm cú pháp -browser trong một thời gian khá dài. Cảm ơn bạn rất nhiều vì đã thêm nó vào "bắt đầu nút" của bạn. – Petrogad

-1
Lets consider Hub running on Machine-A whose IPAddress is = 192.168.10.10 default port no. 4444. 
Lets Node running on Machine-B whose IPAddress is = 192.168.10.20. 
Lets consider operating System on HUB and Node is installed on drive C:\ (C-Drive). 
create a folder named selenium on c:\ as c:\selenium. 
keep binaries of IExplorer.exe, chromeDriver.exe and Selenium-Standalone-server2.10.0.jar. (on both machine A and B). 

configuring HUB on Machine-A 
1- open Command prompt 
2- go to folder selenium using 
     i type cd\ then enter 
     ii type c: then enter 
     iii c:> cd selenium then enter 
3- java -jar selenium-server-standalone-2.20.0.jar -role hub 

Configuring NOde on Machine - B 
1- open Command prompt 
2- go to folder selenium using 
     i type cd\ then enter 
     ii type c: then enter 
     iii c:> cd selenium then enter 
3- java -jar selenium-server-standalone-2.20.0.jar -role node -hub http://192.168.10.10:4444/grid/register -port 5560 -browser browserName=internt explore,maxInstance=4,version=10,platform=WINDOWS -Dwebdriver.ie.driver=c:\selenium\IEDriver.exe 

your node will get register with Hub on port 5560. 

Test Case will become as- 

package testCase; 

import static org.junit.Assert.*; 

import java.net.URL; 
import java.util.concurrent.TimeUnit; 

import org.junit.After; 
import org.junit.Before; 
import org.junit.Test; 
import org.openqa.selenium.By; 
import org.openqa.selenium.WebDriver; 
import org.openqa.selenium.remote.DesiredCapabilities; 
import org.openqa.selenium.remote.RemoteWebDriver; 

public class Avinash_Internet_Explore 
{ 

    WebDriver driver; 
    String baseUrl , nodeUrl; 

    @Before 
    public void setUp() throws Exception 
    { 
     nodeUrl = "http://192.168.10.20:5560/wd/hub"; //Machine-A IPAdress 
                with Port No.   

     DesiredCapabilities capability = DesiredCapabilities.internetExplorer(); 

     driver = new RemoteWebDriver(new URL(nodeUrl),capability); 
     driver.manage().window().maximize(); 
     driver.manage().timeouts().implicitlyWait(2, TimeUnit.MINUTES); 
    } 

    @After 
    public void tearDown() throws Exception 
    { 
     driver.quit(); 
    } 

    @Test 
    public void test() throws InterruptedException 
    { 

     driver.get("https://www.google.co.in");  
     Thread.sleep(3000);  
     driver.findElement(By.linkText("Gmail")).click(); 
     Thread.sleep(3000); 
     driver.findElement(By.id("Email")).sendKeys("[email protected]"); 

     driver.findElement(By.id("Passwd")).sendKeys("********"); 

     driver.findElement(By.id("signIn")).click(); 

     Thread.sleep(6000); 
    } 

} 
Các vấn đề liên quan