0

I'm working with a website where apparently the capitalization of the URLS is important. I need to use ChromeWebDriver for other reasons. The basic problem is that when I'm putting in my URLs using the "-new-window" argument the URL that opens has the URL forced to all lowercase. For example:

ChromeOptions options = new ChromeOptions();
options.AddArgument("-new-window www.example.com/HelloWorld");
m_Browser = new ChromeDriver({path to exe}, options, new TimeSpan(0, 3, 0));

When the browser window opens the website is changed to "www.example.com/helloworld" when I need it to be "www.example.com/HelloWorld"

I know it shouldn't matter but for the sites I'm using it does - if parts of the URL are not capital then the site cannot find the correct page. Is there another argument or something that I'm missing to make it case sensitive?

This is also a bit confusing because if I make a chrome shortcut on my desktop and then add "-new-window www.example.com/HelloWorld" to the target it does properly take me to "www.example.com/HelloWorld" so this is either something else I have wrong in my code or a problem with the chrome webdriver specifically.

I also know I can navigate to the pages manually after creating the browser but I want to know if there is a way to do this properly with the "-new-window" argument.

Kevin
  • 1
  • 1

1 Answers1

0

You need to open the url with the argument as (add extra -):

options.AddArgument("--new-window www.example.com/HelloWorld");

But as per the available ChromeOptions by Peter Beverloo (recomended by Capabilities & ChromeOptions) this doesn't seems to be the right choice as :

  • Argument :

    --new-window    Launches URL in new browser window
    
  • Source Code :

    // Launches URL in new browser window.
    const char kOpenInNewWindow[]               = "new-window";
    

A potential solution would have been using initialBrowserUrl but as of now this option seems to be applicable only for IEDriverServer

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
  • Thanks for the reply! if you run your code does the window open to "www.example.com/HelloWorld" with the H and W capitalized? I tried it with "--new-window" as you suggested and it still is taking me to "www.example.com/helloworld" – Kevin Mar 16 '18 at 19:16