Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
» FlexMonkium Download Not available under Gorillalogic site
Thu Dec 08, 2016 5:40 pm by bhanu.praveen

» Selenium Script issue
Tue Dec 06, 2016 9:48 pm by njain213

» Difference between QTP, Selenium and Silk test
Tue Dec 06, 2016 7:58 pm by jessicacyrus1

» Where does selenium script pick browser from
Tue Dec 06, 2016 1:52 pm by janbaskt

» Safari throws an HTTP ERROR: 404
Tue Dec 06, 2016 1:51 pm by janbaskt

» Access Denied Error in Selenium RC
Tue Dec 06, 2016 1:51 pm by janbaskt

» Automating Flex application through selenium webdriver
Fri Dec 02, 2016 2:06 pm by abhinay.krs

» Starting with Selenium, what is Selenium?
Mon Nov 28, 2016 4:00 pm by Foma

» Getting started with Selenium
Mon Nov 28, 2016 3:23 pm by Rebbelx

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

LocalFileDetector (uploading files) - InternetExplorer Driver (Java platform)

View previous topic View next topic Go down

LocalFileDetector (uploading files) - InternetExplorer Driver (Java platform)

Post by Kristof.Debruyne1982 on Fri Dec 14, 2012 3:14 pm

Hi all,

Currently working with Selenium to automate integration tests.

I'm trying to write a functional test that uploads an XLS file. After digging on the internet for a solution, I saw that when you invoke the sendKeys() method on an WebElement, it is possible to pass a file path but always returning null because by default a UselessFileDetector is instantiated (which really does nothing, and returning null).

When I try to set the LocalFileDetector from InternetExplorerDriver class, an exception is throwed withe the following message:

"Setting the file detector only works on remote webdriver instances obtained via RemoteWebDriver"

Now is my question, how can I obtain an instance via RemoteWebDriver ??

I really don't know how to set the LocalFileDetector for internet explorer webdriver.

Setup: Java + Spring

Code:


@Configuration
@Profile("internet-explorer")
public class InternetExplorerWebDriverConfig {
    @Bean(destroyMethod = "quit")
    public WebDriver internetExplorerDriver() {
        final RemoteWebDriver driver = new InternetExplorerDriver();

        // driver.setFileDetector(new LocalFileDetector());  => this doesn't work

        // When looking for an element on a page, wait 5 seconds if the element is not present yet.
        driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);

        // Modify the screen resolution to the standard resolution for end-users.
        driver.manage().window().setSize(new Dimension(1440, 900));

        return driver;
    }
}

Any thoughts ? Smile

Thanks in advance ! Very Happy

Kristof.Debruyne1982

Posts : 1
Join date : 2012-12-14

Back to top Go down

Re: LocalFileDetector (uploading files) - InternetExplorer Driver (Java platform)

Post by tarun3kumar on Sun Dec 16, 2012 2:02 am

I am little confused with this.
Do you encounter error when running test in grid?
If not then you could use as -

WebDriver driver = new InternetExplorerDriver();

and sendKeys("filePath") should work

_________________
Thanks
Tarun K
Free Selenium Training

tarun3kumar
Master
Master

Posts : 186
Join date : 2012-02-14

http://seleniumtests.com

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum