0

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?

6
  • 1
    Possible duplicate of The method sendKeys(CharSequence[]) in the type WebElement is not applicable for the arguments (String) Basic solutions was "It has a simple solution. Change your compiler compliance level from 1.4 to 1.7." Commented Jan 23, 2017 at 17:54
  • Same error. I will edit answer. Commented Jan 23, 2017 at 18:00
  • Is it the same line that is giving this AssertionVioloatedException error? (SearchBox.sendKeys("Software")) or is this error happening somewhere else. Commented Jan 23, 2017 at 18:06
  • Somewhere you're using the BCEL library for some reason. You might have some tool running that and it's failing. As a workaround you can always try changing to debug mode or something just to see if that can get you around the issue, but the real solution would be figuring out why you're running that library, and how exactly you want to use it. As for your question, I think these two errors are two unrelated issues. Commented Jan 23, 2017 at 18:11
  • Well i thought those 2 errors were related. Here is screen shot of the second error prntscr.com/dzdaci Commented Jan 23, 2017 at 18:29

4 Answers 4

2

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.

Sign up to request clarification or add additional context in comments.

2 Comments

I did just that and resolved the SendKeys problem. But the other problem stayed. The error is in the question.
I think you may have imported from wrong package. It would be easy to figure out if you had expand your all imports.
0

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

Comments

0

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

Comments

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.