Selenium Forum: Functional And Regression Testing Tool.
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Search
Display results as :
Advanced Search
Latest topics
AEM Training | Free Online DemoWed Apr 21, 2021 5:45 pmazharuddin
c# PageFactory - issue initializing elementsFri Nov 01, 2019 8:40 pmthegoatboy
Selenium making automatic connection to random urlsMon Jul 08, 2019 12:58 pmrepairtechsolutions1
How can we design the custom framework in Selenium RCMon Jun 24, 2019 2:26 pmrandybonnettes
What are the new features in Selenium 3.0Tue Jun 18, 2019 5:37 pmpappyvicky
What are you using Selenium for? Fri Apr 12, 2019 3:52 amzhl
LIMITATIONS OF SELENIUMWed Apr 10, 2019 11:23 amswara
Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Go down
avatar
lilsammy
Posts : 2
Join date : 2012-08-14

Outputting to console as events happen. C# Empty Outputting to console as events happen. C#

Tue Aug 14, 2012 5:22 pm
I have a C# windows form application using Selenium.

The program writes what its doing to a rich text box as it does it but after the browser launches the events wont be written to the rich text box as they happen they will be all output after the webdriver has finished carrying out its actions.

My code looks like this:
Code:
  var ProxyIP = "xxx.xxx.xx.xxx:80";

        RtbConsole.AppendText("Setting Up Firefox\n");

        //Firefox driver + proxy setup
        FirefoxProfile profile = new FirefoxProfile();
        String PROXY = ProxyIP;
        OpenQA.Selenium.Proxy proxy = new OpenQA.Selenium.Proxy();
        proxy.HttpProxy = PROXY;
        proxy.FtpProxy = PROXY;
        proxy.SslProxy = PROXY;
        profile.SetProxyPreferences(proxy);

        RtbConsole.AppendText("Launching Firefox\n");
        FirefoxDriver driver = new FirefoxDriver(profile);

        RtbConsole.AppendText("Navigating to removed link \n");
        driver.Navigate().GoToUrl("removed link");


        IWebElement ip = driver.FindElement(By.XPath("/html/body/div/div/h1/span"));
        var myIP = ip.Text;

        RtbConsole.AppendText("Checking IP for Proxy\n");
        if (ProxyIP == myIP + ":80") {
            RtbConsole.AppendText("Proxy Test: Success\n");
        } else {
            RtbConsole.AppendText("Proxy Test: Failed\n");
        }

        //Close the browser
        driver.Quit();

If anyone can explain what I need to do to make it write to console as the actions happen instead of after it finishes that would be awesome.
avatar
lilsammy
Posts : 2
Join date : 2012-08-14

Outputting to console as events happen. C# Empty Re: Outputting to console as events happen. C#

Mon Aug 20, 2012 4:47 pm
Bump still looking for a solution to this.
Back to top
Permissions in this forum:
You cannot reply to topics in this forum