Suddenly my whole program will not run. It shows main error" Missing Type String"

0 votes
System cannot be resolved

The method get(String) from the type WebDriver refers to the missing type String

The method xpath(String) from the type By refers to the missing type String

The method sendKeys(CharSequence...) from the type WebElement refers to the missing type CharSequence

The method xpath(String) from the type By refers to the missing type String

The method sendKeys(CharSequence...) from the type WebElement refers to the missing type CharSequence

The method xpath(String) from the type By refers to the missing type String
Oct 28 in Selenium by Boopathy
• 180 points
62 views

1 answer to this question.

0 votes

It needs to upgrade the Compiler Compliance. 

For Eclipse: Follow the steps below:

  1. Right-click on your java project and select Build Path -> Click on Configure Build Path...
  2. In project properties window: Click/select Java Compiler at the left panel
  3. At the right panel: change the Compiler compliance level from 1.4 to 1.7 or higher
  4. Lastly, Click on Apply and OK

Hope this helps! 

answered Oct 29 by Karan
• 19,570 points

I have changed to Compiler compliance settings 1.4 to 1.7 but won't worked.

Same problems repeated.

In that case, could you please post the code snippet you are using?
Here is the code

package Fourthday;

import org.openqa.selenium.By;

import org.openqa.selenium.WebDriver;

import org.openqa.selenium.WebElement;

import org.openqa.selenium.chrome.ChromeDriver;

public class GoogleLink {

public static void main(String[] args) {

System.setProperty("webdriver.chrome.driver",

"D:\\workspace\\training\\ThirdDay\\bin\\Pack\\Drivers\\chromeDriver.exe");

          WebDriver driver = new ChromeDriver();

         driver.get("https://www.google.com/");

         WebElement search=driver.findElement(By.xpath("//input[@name='q']"));

         search.sendKeys("selenium");

         WebElement word=driver.findElement(By.xpath("(//input[@name='btnK'])[2]"));

         word.submit();

         WebElement last=driver.findElement(By.xpath("//span[contains(text(),'Selenium WebDriver')]"));

         last.click();

}

}
Hey, have you checked for any version compatibility issues?

Related Questions In Selenium

0 votes
1 answer

when I run this code, my browser does not appear, it flashes and disappears.?

Hello, The driver. close() command is used to close the current browser ...READ MORE

answered 15 hours ago in Selenium by Niroj
• 76,540 points
8 views
0 votes
1 answer

Selenium ChromeDriver issue - Want to run it in background, but not as headless browser

This is a flaw with ChromeDriver. Tried ...READ MORE

answered Mar 26, 2018 in Selenium by nsv999
• 5,520 points
3,902 views
+5 votes
3 answers

How to execute a python file with few arguments in java?

You can use Java Runtime.exec() to run python script, ...READ MORE

answered Mar 27, 2018 in Java by DragonLord999
• 8,450 points

edited Nov 6, 2018 by Omkar 33,207 views
+1 vote
1 answer

How to handle drop downs using Selenium WebDriver in Java

First, find an XPath which will return ...READ MORE

answered Mar 27, 2018 in Selenium by nsv999
• 5,520 points
4,637 views
0 votes
1 answer

What are the differences between getText() and getAttribute() functions in Selenium WebDriver?

See, both are used to retrieve something ...READ MORE

answered Apr 5, 2018 in Selenium by nsv999
• 5,520 points
10,715 views
0 votes
1 answer

Selenium JARS(Java) missing from downloadable link

Nothing to worry about here. In the ...READ MORE

answered Apr 5, 2018 in Selenium by nsv999
• 5,520 points
1,983 views