Selenium Forum: Functional And Regression Testing Tool.
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Search
Display results as :
Advanced Search
Latest topics
AEM Training | Free Online DemoWed Apr 21, 2021 5:45 pmazharuddin
c# PageFactory - issue initializing elementsFri Nov 01, 2019 8:40 pmthegoatboy
Selenium making automatic connection to random urlsMon Jul 08, 2019 12:58 pmrepairtechsolutions1
How can we design the custom framework in Selenium RCMon Jun 24, 2019 2:26 pmrandybonnettes
What are the new features in Selenium 3.0Tue Jun 18, 2019 5:37 pmpappyvicky
What are you using Selenium for? Fri Apr 12, 2019 3:52 amzhl
LIMITATIONS OF SELENIUMWed Apr 10, 2019 11:23 amswara
Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Go down
avatar
Kristof.Debruyne1982
Posts : 1
Join date : 2012-12-14

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

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
avatar
tarun3kumar
Master
Master
Posts : 186
Join date : 2012-02-14
http://seleniumtests.com

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

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
Back to top
Permissions in this forum:
You cannot reply to topics in this forum