NoSuchElement found Error on IE8.0!

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

NoSuchElement found Error on IE8.0!

Ajit
Hi

I have written a code in JAVA(Eclipse) to test my application.

I am facing one wired issue.When I am executing the code on IE it is giving me error as "NoSuchElementFound" but if I run the same code on firefox it is working fine.

Error Msg:Exception in thread "main" org.openqa.selenium.NoSuchElementException: Unable to locate element with name: company

The most interesting thing is if I convert my java code to C#(.NET) then my code is working fine on IE.

Can any one please tell me why java code is not running on IE?
Details:
IE 8.0
Webdriver :InternetExplorer,Firefox



Code:

try
{
driver.get("https://enterWebSite.com);
Thread.sleep(10000);
WebDriver driver = new InternetExplorerDriver();
WebElement Company = driver.findElement(By.name("Company"));

Company.sendKeys(new String[] {"Abcd1234"});
}
catch(Exception e)
{
}


'Object details:

<input type="text" maxlength="20" tabindex="1" id="comp_id" accesskey="c" size="8" name="COMPANY" class="signon">

I am getting error for '
Company.sendKeys(new String[] {"Abcd1234"});'

Note : Same code is working fine with FF,so it means that all the required jar files are available with me. For IE I have imported IE webdriver.
Reply | Threaded
Open this post in threaded view
|

Re: NoSuchElement found Error on IE8.0!

softwaretestingforum
Administrator
In your html snippet company is in caps -


<input type="text" maxlength="20" tabindex="1" id="comp_id" accesskey="c" size="8" name="COMPANY" class="signon">

Can you try this for element locator -

WebElement Company = driver.findElement(By.name("COMPANY")); 

Also you don't need to create array for sending, you could use -

Company.sendKeys("Abcd1234"); 

~ seleniumtests.com
Reply | Threaded
Open this post in threaded view
|

Re: NoSuchElement found Error on IE8.0!

@jit
Hey Tarun

I tried with CAPS and with all other combination but still no success.

I have tried couple of application on IE and with every application I am getting either NoSuchElement found or unable to find element with ID...

I have used Thread.Sleep to just cross check whether it is related with performance of application ..I mean whether application is taking time to load the UI...but still no success.

I have two question?
1) Is IE perfect  for Selenium?Do we need to do any settings?
2)How to handle firewall issue with IE?

~Thanks
Reply | Threaded
Open this post in threaded view
|

Re: NoSuchElement found Error on IE8.0!

softwaretestingforum
Administrator
Is there a way for me to access your application? I usually don't face issue with IE-8.
I am quite sure of firewall issue. Could you elaborate?
~ seleniumtests.com