0

I'm trying to build my own password manager. The current site that I'm implementing is starbucks.com.

I'm interfacing with the websites with C# and Selenium webdriver, specifically chromedriver.exe.

The login page, (at https://www.starbucks.com/account/signin), takes good credentials but then dumps me to the homepage without logging me in if the page is launched with chromedriver. Nothing that I do in the page effects this. A manual new browser window works fine but the chromedriver version is being blocked even if there is no interaction with the page and I enter the details and click the button manually.

Looking through the HTML for the page shows a few huge javascript functions that have the string webdriver in them, and I can only assume that it's somehow checking for and blocking the webdriver. If I turn off javascript for the page the login form doesn't work.

I think that this blocking is being preformed by a service called Optimizely. It may be unrelated but I found this flag on their website and it does not effect the problem. The flag looks like this: https://www.starbucks.com/account/signin?optimizely_opt_out=true

I've checked the network traffic between the two button clicks. One with webdriver and one without the webdriver. They're very similar but the normal submit references about half as many cookies. None of them seem to be referencing the webdriver so I'm thinking that the blocking is being deiced before the click. In short, I can't find it.

Does anyone have any idea how this detection of webdriver might work? Is there any way to get around this detection? I think that it's being preformed somewhere in the javascipt.

  • Interesting! Note that it is possible for selenium to be detected: http://stackoverflow.com/questions/33225947/can-a-website-detect-when-you-are-using-selenium-with-chromedriver. – alecxe Mar 20 '16 at 02:08

1 Answers1

1

Looking through the HTML for the page shows a few huge javascript functions

You are attempting to manipulate the page before it has completed loading. You will need to add code to wait for:

  • "jQuery.active == 0"
  • Any loading spinner to be not displayed
  • document.readyState == 'complete'

I have a cucumber-jvm, selenium webdriver, JUnit template project setup on GitHub that implements all this (you will need to customize the loading spinner to fit your app). It is public and you can find it here.

Take a look around and see if it helps.

MikeJRamsey56
  • 2,779
  • 1
  • 20
  • 34