internet-explorer,selenium , Where does default USER PROFILE for the Internet Explorer lives and how do I access it from Selenium?

Where does default USER PROFILE for the Internet Explorer lives and how do I access it from Selenium?


Tag: internet-explorer,selenium

Each time I run a test, I get a new instance of IE, which completely ignore all my settings. I solve the same problem in Firefox and Chrome by setting the option for those browsers to look for a specific user profile.

FirefoxProfile profile = new FirefoxProfile(path/to/profile");
public static readonly IWebDriver WebDriver = new FirefoxDriver(profile);

This is how the path to a user profile looks like in Firefox:


I'd like in which folder the user profile lives in Internet Explorer and how to access it from Selenium.

Thanks for helping


After straggling with this problem for days, I've finally found a solution on YouTube which helped me solve it, at least when it comes to Internet Explorer. I'm still looking for an appropriate solution in Chrome.

  1. One need to download AutoIT as it said in the video
  2. write an AutoIT script, save it, and compile it to produce a executable file as shown in the video
  3. Add an command to execute the AutoIT in the context of your automation.

The last step in the most critical of all. In my case, I've put in the Open Method because it's when I open a page that I get prompted with a authentication popup.

   public virtual void Open(
        string urlParam = "")
        driver.Navigate().GoToUrl(ExpectedPageUrl.Replace("{0}", urlParam));
        Process.Start("path to my AutoIT executable file\BasicAuth.exe");

My AutoIT executable file is called BasicAuth.exe. Now it's working perfectly, i.e. I'm able to run a test on pages that require credentials.


How to avoid wrap in IE7 when I have two ul in a navigation?

In ie8 or firefox browser,My code runs well,the two ul are in the same line.But when I ie7,the two ul are in the diffrent line,How to make then in the same line in ie7? <DIV id='navigation'> <ul><li><span> leftspan </span></li></ul> <ul style='float:right;'> <li><span> leftspan </span></li> <li><a href="" target="_blank">google</a></li> <li><a href="" target="_blank">apple</a></li>...

Find element by class name

I'm trying to find one tag using we.find_element_by_css_selector('p.p1.transfer').text The problem is that there is sometimes a 'strong' tag before the tag I'm searching for which is very similar but it's class is: class="ng-binding ng-hide" instead of class="ng-binding". But when I try to find it it finds the first tag....

selenium webdriver - xpath locator not working if element's text contains Unicode Characters

I'm trying to select an option contained inside a menu. It's not a select menu, but it's styled to appear as such. Anyway, if the text contained inside the menu is in English, I can select it ok. Trouble is, the text I need to select is french so it...

Should I use ids to locate elements?

Started with Angular and Protractor. It just feels wrong to write some heavy css selectors which will break instant when you change something. Using ID's would make testing way easier. I'm not using any id attribute for styling yet. Are there any drawbacks using ids for testing I haven't considered?...

Execute javascript within webpage with selenium WebDriver

I am trying to execute a javascript method on a webpage with the selenium WebDriver. I am able to execute my own script on the page, but not call the method from the page's HTML. Here is the HTML function Search(){ if(check(document.forms[0],"searchResults")){ var fieldCode = ""; var fieldText = "";...

Selenium C# Element Not Found Taking a Long Time

I am using Selenium for C# to test a page. Is there a way to quickly fail if the element is not found on the page? I am experiencing if the HTML element is not found on the page the Selenium test a very long time and then eventually it...

Java Selenium - Can't seem to select an element

I'm trying to select an e-mail href to grab the text, but no matter what selections I use to try to select the e-mail, my selection doesn't seem to work and I am curious what other ways might exist to fix the problem. I have used absolute and relative xpath,...

Webdriver C# -Click second linktext not first

By this line I click on the first text, but how can I click the second exact text? driver.FindElement(By.PartialLinkText("Play")).Click(); ...

Selenium WebDriver: unable to locate element inside iframe using TinyMCE editor

Maybe my question is similar to this Selenium WebDriver NoSuchElementException: Unable to locate element however I still can't find required element. The element itself looks: body id="tinymce" class="mceContentBody" contenteditable="true" onload="window.parent.tinyMCE.get('compose_295_composeEditor').onLoad.dispatch();" dir="ltr" style="overflow: auto;"> the iframe containing this element is: body id="tinymce" class="mceContentBody" contenteditable="true"...

When starting Nightwatch with Grunt, the website server is not started

I am using Nightwatch.js to run system tests for a website. I want to automate the tests by running them via grunt. My Gruntfile contains these lines: ... var nightwatch = require('nightwatch'); nightwatch.initGrunt(grunt); ... nightwatch: { options: { standalone: true, test_settings: { "default": { "launch_url": "http://localhost", "selenium_port": 4444, "selenium_host": "localhost",...

Background-image style with JS not working in ie9

I'm working on a site and im having some issues with my slider in IE9. What I've done is that I've made a div that gets the background image changed every few seconds depending on the img tags within. You can see it in function here: It works wonders...

Not able to click ExtJS Dropdown button and select list elements - Selenium Webdriver Java

I am having difficulty in clicking a drop down and selecting option from the list. Below screenshot of the application. Our application uses heavy ExtJS and below is the HTML code for dropdown button and textbox. <div id="combobox-1115-bodyEl" class="x-form-item-body x-form-trigger-wrap-focus" role="presentation" style="width: 325px;"> <div id="ext-gen1273" class="x-hide-display x-form-data-hidden" role="presentation"></div> <input id="ext-gen1272"...

AJAX in Internet Explorer 11 - Don't cache

I have an issue with AJAX in the IE 11. My page is asking sone values via AJAX form the server using this code: var xmlhttp; if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp = new...

webdriver C# - click this element with XPath position?

I have an element whit this XPath Position: //td[4]/a I try this but does not work: driver.FindElement(By.XPath(".//*[@position='//td[4]/a']")).Click(); Using C# Webdriver and not java, please....

Character rendering is different (IE/Chrome)

I'm trying to figure out why does the arrow symbol render differently on Chrome and Internet Explorer but without any success. Surprisingly IE displays it correctly while Chrome has problems with rendering. Ignore the difference in size, it is due to zooming. Chrome IE Regarding CSS, there is only Eric...

Selenium catch popup on close browser

I'm trying to test that when I close my window a popup shows with a warning message. I've tried both driver.close() and driver.quit() after making sure I'm on the proper window but this just terminates the process since my popup doesn't show. I could test it by using the awt...

How to map browser dialog using capybara/selenium

What is the best way to handle browser dialogs (with ok/cancel buttons) using capybara/selenium? The way I found easiest is by running the following: dialog = page.driver.browser.switch_to.alert dialog.accept Any thoughts for a better approach? Whoever downed this post please give a valid reason... it's not helpful to down vote with...

How do I tell Selenium that an Angular controller has “loaded”

I've got some UI tests that are attempting to test that a click on an element makes something else appear. There's an existing check for all tests that looks to see if the DOM is Ready, however there's a small amount of time between that even firing and the app.controller()...

Junit parameterized testing ,a different thought

Here, I have a custom independent component which accept input as a jar file and identify the junit test classes from it and execute them using the code given below. Result result = JUnitCore.runClasses(cls);//cls is Class<?>instance. Next thing I required is a provision to inject parameters (Assuming that input jar...

IE Input type Date not appearing as Date Picker

I am using the input type DATE in my HTML and everything works fine in Chrome and Firefox, but IE does not show the date picker. When I use the JQuery Datepicker I get two date picker dialogs in Chrome and Firefox. How can I fix this where I can...

WebDriver can't get dropdown menu element (Java)

I write a script on Java for Selenium WebDriver, and I have a problem with selected from dropdown menu. Here's my locator: new Select(driver.findElement("FormElement_select_68_input_input"))).selectByVisibleText("Image"); Here's an error: Here's HTML code: Need to select "Image" from this menu, but have an error. Before I had the error like this,...

Scrapy not entering parse method

I don't understand why this code is not entering the parse method. It is pretty similar to the basic spider examples from the doc: And I'm pretty sure this worked earlier in the day... Not sure if I modified something or not.. from import WebDriverWait from import...

Getting value from div which contains exact string using Selenium IDE

I am trying to get a value from a nested div in a web page using Selenium IDE where class names are repeated but contain unique strings, such as the structure below, but am having no luck. <div class='ClassName'> <div class="col_Num">1 </div> <div class="col_Val">5.00 </div> </div> <div class='ClassName'> <div class="col_Num">2...

Is it possible to save an adobe pdf file using selenium web driver and one click build Jenkins

Here's my dilemma. I'm creating some automation tests using selenium web driver coding in Java. The main output of the software is to load a PDF in adobe acrobat. I'm also using Jenkins which is why my problem has come about as I wont be able to physically see the...

Python Selenium selecting div class

So I'm writing a script using Selenium but I got stuck at finding a div class. The structure on the website is like this: <div class="field first_name"> <input type="text" placeholder="First Name"></input> </div>` Already tried something like driver.find_element_by_xpath("//field[@first_name]") But it didn't work for some reason, maybe I did it wrong or...

close and open browser -selenium C# Visual studio

I want to close and then open the browser without close the driver of selenium, using C# I don't want to: driver.Quit(); How Can I close and the open again the browser Chrome?...

Checking element existence on the page with WebDriver findElements().isEmpty method

I wish to check if some element exists on the page or not. I already saw this WebDriver: check if an element exists? issue but I'm wondering why not simply apply findElements().isEmpty method? I thought it would do the same work. UPD Now I see findElements().isEmpty works perfect so I'm...

Protractor, Done and Expect, why do we need wait?

I thought Done would make things run synchronously, meaning after I click a link, the click call back would happen after the click, apparently not as this doesn't work. browser.ignoreSynchronization = true; var firstURL = ""; describe("test", function () { browser.get(""); it("Should be on google url", function () { expect(browser.getCurrentUrl()).toBe(firstURL);...

Unable to select text boxes in selenium webdriver through XPath?

My HTML <table border="2" style="background:gray"> <tbody> <td class="std"> <input id="ActQ1Revenue" type="text" name="amount" disabled="disabled" maxlength="20" style="background:wheat"> </td> </tr> <tr> <td class="atd"> <input id="ActAprRevenue" type="text" name="amount" maxlength="20"> </td> </tr> <tr> <td class="atd"> <input id="ActMayRevenue" type="text" name="amount" maxlength="20"> </td> </tbody> </table> My XPath...

How to select a text from the autocomplete textbox using selenium

I need to enter some text in a autocomplete textbox. Then I will select a option from that autocomplete option and need to click it. I have tried with the following code: public static void main(String[] args) throws InterruptedException { // TODO Auto-generated method stub String textToSelect = "headlines today";...

XPath for child element

What is the Xpath to select the first element of this jquery selector: $('.A .B:eq(1)') ? HTML Sample <div class="x A z"> <div class="y"> <div class="r B z"></div> <---- that is that I need to select <div class="r B z"></div > ... So far I've tried this: (//div[(@class='A') and div[contains(concat('...

Selenium can't seem to find and click a button on website? - Python

I am trying to make software that automaticly collects data for me from website. It searches for specific term, and then it should press LOAD MORE button at the end of page, and keep clicking it until it loads all the 'gigs'. Anyway, I have good idea of how...

jQuery & CSS only load after many refreshes

If you open this page in IE11, the CSS and jQuery don't load: If you refresh the page once, maybe even twice, it still doesn't load. But if you hit F5 a bunch of times in succession, the CSS and jQuery finally load and the page displays correctly. This...

CSS Selector-How to locate Parent Element

Is there any way to locate parent element in CSS Selector? i am using below code but i am not getting the parent element. WebElement we=dr.findElement(By.cssSelector("div[id='gf-BIG']:parent")); I know there is a way in Xapth but please let me know that how we can locate parent in CSS Selector. ...

Upload file - Protractor

I fight with protractor because for some tests I need to UPLOAD file. My HTML looks like: <div class="panel-footer"> <ul class="list-unstyled"> <!-- ngRepeat: file in imagesToUpload --> </ul> <button class="btn btn-sm btn-success pull-right ng-binding ng-hide" ng-show="imagesToUpload.length" ng-click="uploadImages()">Nahrát na server</button> <button class="btn btn-sm btn-primary ng-binding" ng-file-select="onImageSelect($files)" data-multiple="true" style="overflow: hidden;">Vybrat soubory<input...

Selenium Web Driver : How to map html elements to Java Object.

As part of Selenium Web-driver learning I came across a scenario. Please let me know the professional approach to proceed. I am testing a eCommerce application where while I click on Mobile link all mobile phones are getting displayed.I want to check whether they are sorted based on name and...

Not able to locate the dropdown value using selenium webdriver

I want to select the value from dropdown. Currently I am able to click on dropdown but not able to select the value from the dropdown. Below are the code which I am using for selecting the value from the dropdown.; driver.manage().timeouts().implicitlyWait(1, TimeUnit.SECONDS); Select clickThis = new Select(temp); try{...

How to get selected option using Selenium WebDriver with Python?

How to get selected option using Selenium WebDriver with Python: Someone have a solution for a getFirstSelectedOption? I'm using this to get the select element: try: FCSelect = driver.find_element_by_id('FCenter') self.TestEventLog = self.TestEventLog + "<br>Verify Form Elements: F Center Select found" except NoSuchElementException: self.TestEventLog = self.TestEventLog + "<br>Error: Select FCenter element...

XMLHttpRequest: Network Error 0x80070005, Access is denied on Microsoft Edge (but not IE)

I have a very simple ajax request (see below). The server is using CORS and works fine in IE 10+, Chrome, Firefox and Opera. On Microsoft Edge however, it fails with XMLHttpRequest: Network Error 0x80070005, Access is denied. I have researched the posts here, here, here and here, but cannot...

Return html code of dynamic page using selenium

I'm trying to crawl this website, problem is it's dynamically loaded. Basically I want what I can see from the browser console, not what I see when I right click > show sources. I've tried some selenium examples but I can't get what I need. The code below uses selenium...

selenium exceptions.NoSuchElementException:

The html code snippet as: <thead id="addDet:cust:th" class="emp"> <tr id="addDet:cust:ch" class="emp"> <th class="emp" scope="col" id="addDet:cust:ch:j_idt484">S. No.</th> <th class="emp" scope="col" id="addDet:cust:ch:j_idt487">Name <font color="#FA5882">*</font></th> I tried to fill the field as: driver.find_element_by_id("addDet:cust:j_idt487").send_keys("XX") But I am getting the error as: selenium.common.exceptions.NoSuchElementException: Message: Unable to locate element:...

Selecting elements by ng-model attribute with selenium-webdriver

I am using Ruby and the gem selenium-webdriver I am working with an angular form that I have no control over and would like to know how to find elements via their ng-model attributes. Here is an example select element: <select class="medium-3 small-12 columns ng-pristine ng-valid ng-touched" ng-model="ctrl.type" ng-options=" for...

String replace with regex, ie strange results

Why i have this results? "hello world".replace(/[']/gi, "\\'"); // on chrome => "hello world" "hello world".replace(/[']/gi, "\\'"); // on ie => "hello world" "hello world".replace((/[']/gi).compile(), "\\'"); // on chrome => "hello world" "hello world".replace((/[']/gi).compile(), "\\'"); // on ie => "\'hello world" Chrome: 43.0.2357.124 m IE: 11.0.10011.0...

What is the proper way to get the value of a React