Here are a couple of inquiries:
Firstly: Is there a method to initiate the browser on a specific URL (instead of about:blank) while also setting the history length to 0 when starting on that URL?
Secondly: I suspect this question is related to the one mentioned above
Within the page, the following code snippet is present:
<script type="text/javascript">
function backAway(){
if (navigator.appName == 'Microsoft Internet Explorer'){
// under ie
i = 0;
} else {
//firefox, chrome, etc..
i = 1;
}
if (history.length>i)
{
// there appear to be items in the history property
// this seems to happen with Firefox
// If refferer exists, then do a back
if (document.refferer){
history.back();
} else {
window.close();
}
} else {
window.close();
}
return false;
}
</script>
<a href="" id="declineButton" title="Cancel" class="canc" onclick="backAway(); return false;">Cancel</a>
This section includes some Python Selenium code:
driver = webdriver.Firefox()
driver.get(urlOAuth)
declineButtons = driver.find_elements_by_id('declineButton'])
declineButtons[0].click()
The script successfully locates the declineButton but it doesn't seem to trigger any action upon clicking. The page functions as expected without using selenium.
Any ideas? Recommendations? Questions?