Results 1 to 4 of 4
  1. #1

    Issues using Selenium Webdriver

    Hi folks, I am using Selenium Webdriver but I have an issue with my proxy settings.

    I could configure my proxy when start Firefox using these following commands:

    FirefoxProfile profile = new FirefoxProfile();
    profile.setPreference("network.proxy.type", 1);
    profile.setPreference("network.proxy.http", "ironport");
    profile.setPreference("network.proxy.http_port", 80);
    WebDriver driver = new FirefoxDriver(profile);

    But the popup asking to input username and password is still manual. How can I add these information automatically using FirefoxProfile (or any other suggestion)?


  2. #2

    Re: Issues using Selenium Webdriver

    Go to Run (if the Operation system is Windows)
    firefox -p
    popup appears - click on create new firefox profile
    give a name and save
    now open the browser, navigate to your application and login
    Then use the same profile for your selenium.

    I think this should work fine

  3. #3

    Re: Issues using Selenium Webdriver

    Great, it works! Thanks!

    I have a new issue now.

    I cannot use .sendKeys("") to a textfield (inside a Modal Panel).

    Check my code:
    // Configuring Firefox to run with no proxy
    DesiredCapabilities cap = DesiredCapabilities.firefox();
    Proxy proxy = new Proxy();
    cap.setCapability(CapabilityType.PROXY, proxy);
    WebDriver driver = new FirefoxDriver(cap);

    // Managing 20 seconds timeouts
    driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);

    // Get to the URL

    // Mapped the screen fields
    WebElement login = driver.findElement(By.id("username"));
    WebElement password = driver.findElement(By.id("password"));
    WebElement submit = driver.findElement(By.cssSelector("input.formSubmi t"));

    // Login//Password - Enter

    // Browsing to the CreateMinuta screen
    driver.findElement(By.linkText("Estou tratando")).click();

    // CreateMinuta screen
    System.out.println("Arrives in the screen CreateMinuta!");

    WebElement modalPanel = driver.findElement(By.id("corpo:formularioainelGenericoContainer"));
    System.out.println("Mapped the modal panel!");

    System.out.println("Clicked in the modal panel!");

    WebElement dsArquivo = modalPanel.findElement(By.xpath("//*[@id='corpo:formulario:dsArquivo']"));
    System.out.println("Mapped the field DsArquivo!");

    System.out.println("the field exists!!");

    String teste = "teste123";
    System.out.println("the text was insert!!");

    Check the console:
    Arrives in the screen CreateMinuta!
    Mapped the modal panel!
    Clicked in the modal panel!
    Mapped the field DsArquivo!
    the field exists!!
    Exception in thread "main" org.openqa.selenium.WebDriverException: org.apache.http.NoHttpResponseException: The target server failed to respond
    Build info: version: '2.5.0', revision: '13516', time: '2011-08-23 18:30:44'
    System info: os.name: 'Windows XP', os.arch: 'x86', os.version: '5.1', java.version: '1.6.0_27'
    Driver info: driver.version: RemoteWebDriver
    at org.openqa.selenium.remote.RemoteWebDriver.execute (RemoteWebDriver.java:406)
    at org.openqa.selenium.remote.RemoteWebElement.execut e(RemoteWebElement.java:191)
    at org.openqa.selenium.remote.RemoteWebElement.click( RemoteWebElement.java:49)
    at org.openqa.selenium.example.Script_003.runTest003( Script_003.java:73)
    at org.openqa.selenium.example.Script_003.main(Script _003.java:117)
    Caused by: org.apache.http.NoHttpResponseException: The target server failed to respond
    at org.apache.http.impl.conn.DefaultResponseParser.pa rseHead(DefaultResponseParser.java:101)
    at org.apache.http.impl.io.AbstractMessageParser.pars e(AbstractMessageParser.java:252)

  4. #4

    Re: Issues using Selenium Webdriver

    Change the code:
    String teste = "teste123";

    to just:


    and then try to execute...



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
BetaSoft Inc.
All times are GMT -8. The time now is 05:48 PM.

Copyright BetaSoft Inc.