I am creating a Selenium testing framework. I have created my baseclass and am adding things now. It is at a basic stage but already when executing a test class I get Warnings that Im not following W3C syntax. I have tried to google the error and understand where I am not following it, but the articles i find only mention the deprecated setCapabilites. What am I doing wrong?
Console Log text:
ChromeDriver was started successfully.
May 29, 2022 2:21:12 P.M. org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected upstream dialect: W3C
May 29, 2022 2:21:12 P.M. org.openqa.selenium.W3CCapabilityKeysValidator validateCapability
WARNING: Support for Legacy Capabilities is deprecated; You are sending "chrome" which is an invalid capability. Please update to W3C Syntax: https://www.selenium.dev/blog/2022/legacy-protocol-support/
May 29, 2022 2:21:12 P.M. org.openqa.selenium.W3CCapabilityKeysValidator validateCapability
WARNING: Support for Legacy Capabilities is deprecated; You are sending "chrome" which is an invalid capability. Please update to W3C Syntax: https://www.selenium.dev/blog/2022/legacy-protocol-support/
May 29, 2022 2:21:12 P.M. org.openqa.selenium.W3CCapabilityKeysValidator validateCapability
WARNING: Support for Legacy Capabilities is deprecated; You are sending "networkConnectionEnabled" which is an invalid capability. Please update to W3C Syntax: https://www.selenium.dev/blog/2022/legacy-protocol-support/
May 29, 2022 2:21:12 P.M. org.openqa.selenium.W3CCapabilityKeysValidator validateCapability
WARNING: Support for Legacy Capabilities is deprecated; You are sending "networkConnectionEnabled" which is an invalid capability. Please update to W3C Syntax: https://www.selenium.dev/blog/2022/legacy-protocol-support/
May 29, 2022 2:21:12 P.M. org.openqa.selenium.W3CCapabilityKeysValidator validateCapability
WARNING: Support for Legacy Capabilities is deprecated; You are sending "platform" which is an invalid capability. Please update to W3C Syntax: https://www.selenium.dev/blog/2022/legacy-protocol-support/
May 29, 2022 2:21:12 P.M. org.openqa.selenium.W3CCapabilityKeysValidator validateCapability
WARNING: Support for Legacy Capabilities is deprecated; You are sending "platform" which is an invalid capability. Please update to W3C Syntax: https://www.selenium.dev/blog/2022/legacy-protocol-support/
May 29, 2022 2:21:12 P.M. org.openqa.selenium.W3CCapabilityKeysValidator validateCapability
WARNING: Support for Legacy Capabilities is deprecated; You are sending "javascriptEnabled" which is an invalid capability. Please update to W3C Syntax: https://www.selenium.dev/blog/2022/legacy-protocol-support/
May 29, 2022 2:21:12 P.M. org.openqa.selenium.W3CCapabilityKeysValidator validateCapability
WARNING: Support for Legacy Capabilities is deprecated; You are sending "javascriptEnabled" which is an invalid capability. Please update to W3C Syntax: https://www.selenium.dev/blog/2022/legacy-protocol-support/
May 29, 2022 2:21:12 P.M. org.openqa.selenium.devtools.CdpVersionFinder findNearestMatch
INFO: Found exact CDP implementation for version 101
May 29, 2022 2:21:12 P.M. org.openqa.selenium.W3CCapabilityKeysValidator validateCapability
WARNING: Support for Legacy Capabilities is deprecated; You are sending "chrome" which is an invalid capability. Please update to W3C Syntax: https://www.selenium.dev/blog/2022/legacy-protocol-support/
May 29, 2022 2:21:12 P.M. org.openqa.selenium.W3CCapabilityKeysValidator validateCapability
WARNING: Support for Legacy Capabilities is deprecated; You are sending "javascriptEnabled" which is an invalid capability. Please update to W3C Syntax: https://www.selenium.dev/blog/2022/legacy-protocol-support/
May 29, 2022 2:21:12 P.M. org.openqa.selenium.W3CCapabilityKeysValidator validateCapability
WARNING: Support for Legacy Capabilities is deprecated; You are sending "networkConnectionEnabled" which is an invalid capability. Please update to W3C Syntax: https://www.selenium.dev/blog/2022/legacy-protocol-support/
May 29, 2022 2:21:12 P.M. org.openqa.selenium.W3CCapabilityKeysValidator validateCapability
WARNING: Support for Legacy Capabilities is deprecated; You are sending "platform" which is an invalid capability. Please update to W3C Syntax: https://www.selenium.dev/blog/2022/legacy-protocol-support/
May 29, 2022 2:21:12 P.M. org.openqa.selenium.W3CCapabilityKeysValidator validateCapability
WARNING: Support for Legacy Capabilities is deprecated; You are sending "networkConnectionEnabled" which is an invalid capability. Please update to W3C Syntax: https://www.selenium.dev/blog/2022/legacy-protocol-support/
May 29, 2022 2:21:12 P.M. org.openqa.selenium.W3CCapabilityKeysValidator validateCapability
WARNING: Support for Legacy Capabilities is deprecated; You are sending "chrome" which is an invalid capability. Please update to W3C Syntax: https://www.selenium.dev/blog/2022/legacy-protocol-support/
May 29, 2022 2:21:12 P.M. org.openqa.selenium.W3CCapabilityKeysValidator validateCapability
WARNING: Support for Legacy Capabilities is deprecated; You are sending "platform" which is an invalid capability. Please update to W3C Syntax: https://www.selenium.dev/blog/2022/legacy-protocol-support/
May 29, 2022 2:21:12 P.M. org.openqa.selenium.W3CCapabilityKeysValidator validateCapability
WARNING: Support for Legacy Capabilities is deprecated; You are sending "javascriptEnabled" which is an invalid capability. Please update to W3C Syntax: https://www.selenium.dev/blog/2022/legacy-protocol-support/
May 29, 2022 2:21:12 P.M. org.openqa.selenium.W3CCapabilityKeysValidator validateCapability
WARNING: Support for Legacy Capabilities is deprecated; You are sending "networkConnectionEnabled" which is an invalid capability. Please update to W3C Syntax: https://www.selenium.dev/blog/2022/legacy-protocol-support/
May 29, 2022 2:21:12 P.M. org.openqa.selenium.W3CCapabilityKeysValidator validateCapability
WARNING: Support for Legacy Capabilities is deprecated; You are sending "chrome" which is an invalid capability. Please update to W3C Syntax: https://www.selenium.dev/blog/2022/legacy-protocol-support/
May 29, 2022 2:21:12 P.M. org.openqa.selenium.W3CCapabilityKeysValidator validateCapability
WARNING: Support for Legacy Capabilities is deprecated; You are sending "platform" which is an invalid capability. Please update to W3C Syntax: https://www.selenium.dev/blog/2022/legacy-protocol-support/
May 29, 2022 2:21:12 P.M. org.openqa.selenium.W3CCapabilityKeysValidator validateCapability
WARNING: Support for Legacy Capabilities is deprecated; You are sending "javascriptEnabled" which is an invalid capability. Please update to W3C Syntax: https://www.selenium.dev/blog/2022/legacy-protocol-support/
May 29, 2022 2:21:12 P.M. org.openqa.selenium.W3CCapabilityKeysValidator validateCapability
WARNING: Support for Legacy Capabilities is deprecated; You are sending "networkConnectionEnabled" which is an invalid capability. Please update to W3C Syntax: https://www.selenium.dev/blog/2022/legacy-protocol-support/
May 29, 2022 2:21:12 P.M. org.openqa.selenium.W3CCapabilityKeysValidator validateCapability
WARNING: Support for Legacy Capabilities is deprecated; You are sending "chrome" which is an invalid capability. Please update to W3C Syntax: https://www.selenium.dev/blog/2022/legacy-protocol-support/
May 29, 2022 2:21:12 P.M. org.openqa.selenium.W3CCapabilityKeysValidator validateCapability
WARNING: Support for Legacy Capabilities is deprecated; You are sending "platform" which is an invalid capability. Please update to W3C Syntax: https://www.selenium.dev/blog/2022/legacy-protocol-support/
May 29, 2022 2:21:12 P.M. org.openqa.selenium.W3CCapabilityKeysValidator validateCapability
WARNING: Support for Legacy Capabilities is deprecated; You are sending "javascriptEnabled" which is an invalid capability. Please update to W3C Syntax: https://www.selenium.dev/blog/2022/legacy-protocol-support/
May 29, 2022 2:21:12 P.M. org.openqa.selenium.W3CCapabilityKeysValidator validateCapability
WARNING: Support for Legacy Capabilities is deprecated; You are sending "chrome" which is an invalid capability. Please update to W3C Syntax: https://www.selenium.dev/blog/2022/legacy-protocol-support/
May 29, 2022 2:21:12 P.M. org.openqa.selenium.W3CCapabilityKeysValidator validateCapability
WARNING: Support for Legacy Capabilities is deprecated; You are sending "javascriptEnabled" which is an invalid capability. Please update to W3C Syntax: https://www.selenium.dev/blog/2022/legacy-protocol-support/
May 29, 2022 2:21:12 P.M. org.openqa.selenium.W3CCapabilityKeysValidator validateCapability
WARNING: Support for Legacy Capabilities is deprecated; You are sending "networkConnectionEnabled" which is an invalid capability. Please update to W3C Syntax: https://www.selenium.dev/blog/2022/legacy-protocol-support/
May 29, 2022 2:21:12 P.M. org.openqa.selenium.W3CCapabilityKeysValidator validateCapability
WARNING: Support for Legacy Capabilities is deprecated; You are sending "platform" which is an invalid capability. Please update to W3C Syntax: https://www.selenium.dev/blog/2022/legacy-protocol-support/
My base class:
package resources;
import java.io.FileInputStream;
import java.io.IOException;
import java.time.Duration;
import java.util.Properties;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.ie.InternetExplorerDriver;
public class base {
public WebDriver driver;
public Properties prop;
public WebDriver initializeDriver() throws IOException {
FileInputStream fis=new FileInputStream("D:\\Projects\\EclipseWorkspace\\E2EPrj\\src\\main\\java\\resources\\data.properties");
prop = new Properties();
prop.load(fis);
String browserName = prop.getProperty("browser");
if(browserName.equals("chrome"))
{
//execute in chromedriver
ChromeOptions options = new ChromeOptions();
options.addArguments("start-maximized");
System.setProperty("webdriver.chrome.driver","D:\\Projects\\chromedriver.exe");
driver = new ChromeDriver(options);
}
else if(browserName.equals("firefox"))
{
//execute in geckodriver
System.setProperty("webdriver.chrome.driver","D:\\Projects\\geckodriver.exe");
driver = new FirefoxDriver();
}
else if(browserName.equals("IE"))
{
//execute in IEdriver
System.setProperty("webdriver.chrome.driver","D:\\Projects\\IEDriverServer.exe");
driver = new InternetExplorerDriver();
}
driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(3));
// driver.manage().deleteAllCookies();
return driver;
}
// public String getScreenShotPath(String testCaseName, WebDriver driver) throws IOException
// {
// TakesScreenshot ts=(TakesScreenshot) driver;
// File source = ts.getScreenshotAs(OutputType.FILE);
// String destinationFile = ".\\reports\\"+testCaseName+".png";
// FileUtils.copyFile(source, new File(destinationFile));
// return destinationFile;
// }
}