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, 2020 in Selenium by Boopathy
• 370 points
6,309 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, 2020 by Karan
• 19,610 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 Nov 23, 2020 in Selenium by Niroj
• 82,840 points
2,075 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 27, 2018 in Selenium by nsv999
• 5,500 points
8,062 views
+5 votes
4 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 7, 2018 by Omkar 81,222 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,500 points
8,357 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,500 points
17,432 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,500 points

edited Aug 4, 2023 by Khan Sarfaraz 4,875 views
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP