Showing posts with label chrome. Show all posts
Showing posts with label chrome. Show all posts

org.openqa.selenium.WebDriverException: unknown error: call function result missing 'value'

I was seeing the same issue. The problem only appears when using Chrome 65 (currently: dev channel). With Chrome 64 (both stable channel and beta channel) everything worked fine.

It turns out I had an old chromedriver installed. Specifically, I was using chrome=65.0.3325.51 with chromedriver=2.29.461585. Running npm install -g chromedriver bumped chromedriver to 2.35.528157 and now the problem is solved. Hope this helps!

TL;DR: run npm install -g chromedriver



If you are using driver without NPM, Download the latest driver and use it in your project. 

You may want to give execute permissions for newly downloaded driver.

chmod 777 chromedriver

How to save Objects in local storage in Chrome + JavaScript

local storage limited to handle only string key/value pairs you can do like below using JSON.stringify and while getting value JSON.parse

var testObject = {name:"test", time:"Date 2017-02-03T08:38:04.449Z"};
Put the object into storage:

localStorage.setItem('testObject', JSON.stringify(testObject));
Or
localStorage['testObject'] = JSON.stringify(testObject));

Retrieve the object from storage:
var retrievedObject = localStorage.getItem('testObject');
Or
var retrievedObject = localStorage['testObject'];

console.log('retrievedObject: ', JSON.parse(retrievedObject));

Open link in a new tab using Chrome Browser + Selenium Java

Actions action = new Actions(driver);
WebElement link = driver.findElement(By.linkText("Gmail")); action.moveToElement(link).keyDown(Keys.CONTROL).click(link).build().perform();


Note:
For windows, this is Keys.CONTROL
For Mac, this is Keys.COMMAND

Location of Chrome Extension Source code on Windows

C:\Users\%USERNAME%\AppData\Local\Google\Chrome\User Data\Default\Extensions

Location of Chrome Extension Source Code On Mac OS X

~/Library/Application Support/Google/Chrome/Default

How to get or fetch the URL of a Google Chrome tab

First, you've to set the permissions for the tab API :

"permissions": [
    "tabs"
]

And to store the URL :
 
chrome.tabs.getSelected(null,function(tab) {
    var tablink = tab.url;
});

Select box inside a floating div does not dropdown on clicking the arrow

The problem is when you have a select with a parent div having a return false in a
mousedown event, like this :

<div id="container"&gt;

<select><option></option><option>dsqds</option><option></option></select>
</div>

<script>
$(function(){

$('#container').mousedown(function(){

return false;
});

});
</script>

all other browsers keep the select being selectAble but chrome says no !

So easy fix is either remove the parent div tag. or stop throwing false on mouse down event.

Google is yet to fix this error.

Ref: http://code.google.com/p/chromium/issues/detail?id=7423
Version: 21.0.1180.83 m