0

I have an already working project in java 1.7, but when I move it to Java 1.8 there are some things to convert to keep it working in 1.8. One of those is the following:

WebElement weAux;
(... some code....)
weAux.SendKeys(Keys.TAB);

I am Using IntelliJIdea 15.0.2 and it has an inspection that claims the following:

"sendKeys (java.lang.CharSequence...) in WebElement cannot be applied to (org.openqa.selenium.Keys)"

Keys.TAB is from org.openqa.selenium.Keys;

Thanks in advance. Atilio

Mukesh Takhtani
  • 852
  • 5
  • 15
El Ati
  • 21
  • 5

2 Answers2

2

It was a IntelliJ configuration Issue.

Somehow when changed from SDK 1.7 a 1.8, the "Project language level" changed.

Steps to solve the issue:

File-->Project Structure-->ProjectSettings-->Project In "Project Language level" field select "7-Diamonds, ARM, Multi catch etc" Somehow it was set to "1.3 plain old java"

Thanks for your collaboration

El Ati
  • 21
  • 5
0

You can change JRE version to 1.7 to be default for execution. From eclipse prospective Project>>right click>>build path>> configure build path. in configure build path go to Libraries tab. Delete JRE 8 or JRE 1.8. go to add library >> JRE System Library >> select alternate JRE (mat be 7 or 1.7)

Thank You, Murali

murali selenium
  • 3,847
  • 2
  • 11
  • 20
  • Thanks Murali, but in this case I specifically need to run in Java 1.8.* . It runs fine on Java 1.7 – El Ati Jan 12 '16 at 14:13
  • As code is developed in 1.7, to work it in 1.8, mostly I think we need to create simple methods to convert these chars to may be string to work in 1.8. I am in journey, I will check and let you know – murali selenium Jan 12 '16 at 15:01
  • try like this driver.findElement(By.id("lst-ib")).sendKeys(new String("\uE004")); – murali selenium Jan 12 '16 at 15:48