prioritizr / wdpar

Interface to the World Database on Protected Areas
https://prioritizr.github.io/wdpar
GNU General Public License v3.0
37 stars 5 forks source link

Error: Summary: ElementNotVisible #8

Closed jeffreyhanson closed 5 years ago

jeffreyhanson commented 5 years ago

A couple of people (and many thanks to them for bringing this to my attention) have encountered the following error message when running wdpa_fetch:

Error:  Summary: ElementNotVisible
        Detail: An element command could not be completed because the element is not 
                visible on the page.
        class: org.openqa.selenium.ElementNotVisibleException
        Further Details: run errorDetails method

After some detective work, it appears this error is being thrown by the Rselenium web driver when trying to click on a button (rd$clickElement() in wdpa_url.R) to navigate the http://protectedplanet.net website.

jeffreyhanson commented 5 years ago

I was able to reproduce this bug on my Windows 7 system, but not on my Ubuntu laptop. It seems that this issue can be fixed by telling R to sleep for a few seconds before trying to click the button. This is strange (to me, at least) because (i) my Windows 7 computer has faster internet access than my Ubuntu laptop (i.e. it is connected to the same network as the laptop, but using an ethernet cable instead of a wireless connection), and yet (ii) my Ubuntu laptop does not need to wait before clicking the button.

smjohnson670 commented 5 years ago

Hi Jeff - how do you tell "R to sleep for a few seconds before trying to click the button"? Would be useful tip.

Thanks

jeffreyhanson commented 5 years ago

Hi - I was just documenting a fix for the bug that I'll need to patch into wdpar. It's not really something that can addressed by an end user. The notes were mainly for my benefit in case this bug comes up again in later releases of Rselenium or if they change the https://protectedplanet.net website. I'm just about to release a new version on GitHub with the patch.

jeffreyhanson commented 5 years ago

@smjohnson670, I've just released the new version on GitHub which fixes this problem on my computer. If you're experiencing this bug with the version on CRAN, could you please try installing the development version on GitHub (see README for instructions) and see if it works?

smjohnson670 commented 5 years ago

@jeffreyhanson thanks. the fix is working on my end now.

jeffreyhanson commented 5 years ago

@smjohnson670, great - thank you very much for letting me know that the fix worked for you.