Selenium RC 403 Error - Forbidden to proxy server

I am trying to run Selenium RC 1.0.3 using Java 6, JUnit 4 and Eclipse on Snow Leopard.

Here is my test class, from Selenium docs:

public class TestCase extends SeleneseTestCase {

  @Before
  public void before() throws Exception {
    setUp("http://www.google.com/", "*firefox");
  }

  @Test
  public void test() {
    selenium.open("/");
    selenium.type("q", "selenium rc");
    selenium.click("btnG");
    selenium.waitForPageToLoad("30000");
    assertTrue(selenium.isTextPresent("Advanced search"));
  }
}

I get the following error that occurs during a call selenium.open():

11:16:59.916 INFO - Got result: 
XHR ERROR: URL = http://localhost:4444/ Response_Code = 403 
Error_Message = Forbidden+for+Proxy on session a8cf1e0bd5ed42c5a4df0c25ec5f5286

I tried to find various offers on the Internet, replacing *firefoxwith *chromeor *firefox, replacing httpwith httpsand adding selenium.start(), but no one helped or even changed the behavior.

Any ideas?

EDIT: The selenium server is up and the local firewall is down.

+3
source share
1 answer

, : @Before , setUp() @Test, :

@Test
public void test() throws Exception {
  setUp("http://www.google.com/", "*chrome");
  selenium.open("/");
  selenium.type("q", "selenium rc");
  selenium.click("btnG");
  selenium.waitForPageToLoad("30000");
  assertTrue(selenium.isTextPresent("Advanced search"));
}

, :

import com.thoughtworks.selenium.SeleneseTestCase;

public class TestCase extends SeleneseTestCase {

  public void setUp() throws Exception {
    setUp("http://www.google.com/", "*firefox");
  }

  public void testAuto() throws Exception {
    selenium.open("/");
    selenium.type("q", "selenium rc");
    selenium.click("btnG");
    selenium.waitForPageToLoad("30000");
    assertTrue(selenium.isTextPresent("Advanced search"));
  }
}

, SeleneseTestCase TestCase JUnit 3. JUnit 4, , .

+1

Source: https://habr.com/ru/post/1747029/


All Articles