Re: unable to open Google Chrome browser and execute a test script

6,742 views
Skip to first unread message

darrell

unread,
Apr 17, 2013, 9:56:37 PM4/17/13
to webd...@googlegroups.com
First, you should install Chrome properly. If you have been copying files to different locations, stop that. There are two reasons. The first is that you could be destabilizing Chrome and making it run improperly. The second is that I would be quite surprised to find end users who will do this as well. If you are writing functional tests and using WebDriver to automate them then you do not want to do special things to make your tests work. You want to make the test automate what you would have done manually.

Second, you can set the property as you have but why place ChromeDriver in the "Program Files" directory? Spaces in a file path is just asking for trouble. Keep it as simple as possible. You don't need to make it unnecessarily complicated. Create a directory call "C:\chromedriver", place the ChromeDriver.exe in that directory then set the property to the correct location. Even easier, place the ChromeDriver.exe into C:\Windows\System32. No space and it is in the PATH. If it is in the PATH there is no need to set the property.

Darrell


On Tuesday, 16 April 2013 15:27:36 UTC-4, Naveen Kumar Tatikonda wrote:
Hi,

I have created a sample test and 'm able to execute on Firefox browser successfully. I've updated the script to work on Chrome but getting some errors. Here are the details,


import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;


public class WebLoginTest {

/**
* @param args
* @throws InterruptedException 
*/
public static void main(String[] args) throws InterruptedException {
try 
{
System.setProperty("webdriver.chrome.driver", "C:/Program Files/chromedriver.exe");
WebDriver TestDriver = new ChromeDriver();
                 TestDriver.get("http://ariesstage.corproot.com/iw-integration/WVR"); //This is my internal site          
                 TestDriver.findElement(By.name("user")).sendKeys("georgereid");
                 TestDriver.findElement(By.name("password")).sendKeys("Test1234");
                 TestDriver.findElement(By.className("formButton")).click();
                 Thread.sleep(4000);
                 TestDriver.findElement(By.partialLinkText("Log Out")).click();
                 TestDriver.close();
                 TestDriver.quit();
}
catch(Throwable t){
            System.out.println("Test Result: Fail\n");
            System.out.println("StackTrace: "+t.getStackTrace());
        }
}
}

-----------------------------

1. I have copied Chrome.exe at C:\Users\Userid\AppData\Local\Chrome\Application\
2. Also copied Chromedriver.exe at C:\ProgramFiles\

I'm getting below error while executing,

"Could not load extension from 'C:\Users\C03049\AppData\Local\Temp\scoped_dir45`6_4977\internal'. Loading of unpacked extensions is disabled by the administrator. 

attached screenshot for info.

Thanks,
Naveen

Naveen Kumar Tatikonda

unread,
Apr 22, 2013, 1:50:30 PM4/22/13
to webd...@googlegroups.com
Hi Darrell,

Thanks for your reply. 

I made the changes to Chromedriver (moved to System32 folder in one scenario and created a folder separately and placed chromedriver.exe), facing same issue (mentioned in previous post) in both the cases. 

do you think, is it issue with chrome browser? I see that browser is getting opened and closed immediately and throws exception. Please help me.

Thanks,
Naveen

Mark Collin

unread,
Apr 23, 2013, 1:43:40 AM4/23/13
to webd...@googlegroups.com

Sounds like you have blacklisted extensions.

 

**Warning** DO NOT MODIFY ANYTHING IF YOU CHECK YOUR REGISTRY, if you do you could make your machine unusable.

 

To check to see if you have got any extensions blacklisted do the following:

 

·         Press Windows Key + R

·         Type “regedit” and click “OK”

·         Navigate to “HKEY_CURRENT_USER\Software\Policies\Google\Chrome\ExtensionInstallBlacklist” and see if you are blocking extensions

·         Navigate to “HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome\ExtensionInstallBlacklist” and see if you are blocking extensions

 

If either of the above keys are set in the registry it would imply that an administrator has configured your machine to refuse installation of chrome extensions.  If this is the case the WebDriver extensions will not be able to be loaded into Chrome hence the error you are seeing. 

 

The fix would be to talk to your IT team and find out why they have blacklisted chrome extensions, you will need them to enable them if you want to run Selenium tests.

 

More info about chrome blacklists is available here:

 

http://www.chromium.org/administrators/policy-list-3#ExtensionInstallBlacklist

--
You received this message because you are subscribed to the Google Groups "webdriver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to webdriver+...@googlegroups.com.
To post to this group, send email to webd...@googlegroups.com.
Visit this group at http://groups.google.com/group/webdriver?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

darrell

unread,
Apr 23, 2013, 6:56:13 PM4/23/13
to webd...@googlegroups.com
Running Selenium and creating a ChromeDriver will start up the ChromeDriver.exe. However, you can also run ChromeDriver.exe from a command prompt. Try opening cmd.exe and run ChromeDriver.exe. It should start and print some information. It will then sit there and wait for Selenium. My guess is that it will not start properly. Instead you will see an error message. That message should help you figure out what is wrong. If not, you can tell us what ChromeDriver.exe output when you ran it.

Darrell
Reply all
Reply to author
Forward
0 new messages