Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The blue button #3

Open
robjens opened this issue Apr 19, 2015 · 3 comments
Open

The blue button #3

robjens opened this issue Apr 19, 2015 · 3 comments

Comments

@robjens
Copy link

robjens commented Apr 19, 2015

I am using clj-webdriver for my consent window. Using that, I can do

      (wait-until #(not (empty? (find-elements {:xpath "//button[@id='submit_approve_access' and not(@disabled)]"}))) (* 15000))

The xpath expression allows to define a condition which the css selectors do not offer, that is to select upon state of the element. Using a 15 second window in which the web page and consent screen must have loaded and disabled the blue button by script.

Lookup the JavaScript solution, as this is Clojure, but the functionality comes straight from webdriver/selenium and it demonstrates the how anyway, this might give a little closure ;) (last paragraph of your readme is about this)

@robjens
Copy link
Author

robjens commented Apr 19, 2015

Oh and one extra gotcha was that, with webdriver/selenium firefox driver, it starts inside my /tmp and so it uses a anonymous user profile in firefox (temporary). As such, I needed to pass it the additional commands and data to fill in the gmail username/email and password first, before I could get to a consent window.

Next step: xvfb and true headless to work... ><

@regular
Copy link
Owner

regular commented Apr 19, 2015

Hi @robjens, thanks for the hint. Good to know that it works with selenium. Feel free to send a pull request in case you port your code to JS ;)

@robjens
Copy link
Author

robjens commented Apr 20, 2015

I'll take a look sometime soon ^^

edit: it should be along these lines, no means or time to setup an environment and actually test it :P

driver.wait(function() {
    driver.findElement(By.id('submit_approve_access')).isEnabled().then(function(element) {
        element.click();
  });
}, 15000);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants