1

I have a web application in asp.net 4.0 and at some moment I have to access a link outside my domain and fill it up with some info, log-in, and other stuff like dates. I want to automate this process.

This is what I want:

User clicks on a button, the link to the other site opens on a new tab with the textboxes filled with info from my application. The User informs the captcha and press "Continue". The web-site will validate info and log him in, then there'll be more steps like this when logged in.

What I've tried:

Iframe on my app - Wasn't able to get access to the DOM elements inside of it.

Using javascript - Something like:

var window = window.open("site"); 
window.getElementById(""); 

but still got no success.

And then finnaly I tried Selenium, which is a framework for automating tests and I want to perform tasks, not testing. I got it working with selenium, actually it worked like a charm.

Code:

            var browser = Request.Browser;

            IWebDriver driver = null;
            switch (browser.Browser)
            {
                case "Chrome":
                    driver = new ChromeDriver(Server.MapPath("path"));
                    break;
                default:
                    driver = new FirefoxDriver();
                    break;
            }

            driver.Navigate().GoToUrl("url");

            IWebElement field = driver.FindElement(By.Id("fieldId"));
            field .SendKeys("info i want to send");
            ...

The problem is that I have to publish my app because I have a lot of users using it(that's the main reason I'm trying to automate this process). And when I published it to my local IIS for testing, it stopped working and I don't know what to do or what to search for. Any help would be appreciated, thanks in advance.

4
  • Well what does "stopped working" mean? What errors are you getting? We really cannot help with "It stopped working". Commented Sep 23, 2014 at 13:12
  • I'm not getting any error, it just don't open the browser window and neither runs the driver as it does on VS Debug. Or it runs both browser and driver backgrounds, which isn't what I want. Commented Sep 23, 2014 at 13:18
  • What you're trying to do sounds an awful lot like what a malware would try to do, so you're fighting against some pretty good security mechanisms. Have you tried talking with the external domain owners? Maybe they expose an API that you could use, which is the typical way applications talk to each other. Commented Sep 23, 2014 at 15:28
  • possible duplicate of Can we run Selenium WebDriver Test case with IIS, instead of Visual Studio Development server Commented Sep 23, 2014 at 18:02

1 Answer 1

1

I've managed to find the solution on this quite similar question:

Can we run Selenium WebDriver Test case with IIS, instead of Visual Studio Development server

To make it work, I needed to create start a RemoteWebDriverServer following those 2 steps. You can find more info about it here: Selenium RC info.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.