edinvnode
edinvnode

Reputation: 3557

Selenium automation with Java

I am doing a basic selenium test with Java using Eclipse. I am following this tutorial.

https://www.youtube.com/watch?v=2SzdhH8xAX4

But I get the error when trying to run the code.

enter image description here

And here is this too.

Exception in thread "main" org.apache.bcel.verifier.exc.AssertionViolatedException: 
FOUND:
    INTERNAL ERROR: Oops!
Exiting!!

    at org.apache.bcel.verifier.exc.AssertionViolatedException.main(AssertionViolatedException.java:102)

Anyone care to help me solve this problem and execute this simple test?

Upvotes: 0

Views: 1765

Answers (4)

Rutvij Patel
Rutvij Patel

Reputation: 1

webelement searchBox =  driver.findElement(By.id("SearchInput")).sendkeys("Software");

Upvotes: 0

hasini ishara
hasini ishara

Reputation: 59

I have got a same error. SearchBox.sendKeys(new String[] { "Software" }); This is work for me.

Upvotes: 0

Lucky
Lucky

Reputation: 341

It's problem with compiler compliance level. Change level by following procedure. Right click on your Java Project->Properties->Java compiler->Change compiler compliance level to 1.7.

Upvotes: 2

MatWdo
MatWdo

Reputation: 1740

The problem is, that the signature is a var-array, that is CharSequence[] instead of just CharSequence.

Try this:

SearchBox.sendKeys(new String[] { "Software" });

And what is important, please change value name, because all filed must start from lowercase, is a good practice

Upvotes: 0

Related Questions