Are you struggling to get started with Selenium WebDriver in Java? Well this post will help you to resolve the most annoying Selenium WebDriver with Java errors.
java.lang.IllegalStateException: The driver is not executable: …/chromedriver
Error Message
java.lang.IllegalStateException: The driver is not executable: /Users/nikolayadvolodkin/Documents/source/java/selenium-java/resources/mac/chromedrive
The Problem
The issue is that you need to download the correct Chromedriver version for your OS
The Solution
The solution is here, see my comment in SO as well.
“chromedriver” cannot be opened because the developer cannot be verified.
Error Message
“chromedriver” cannot be opened because the developer cannot be verified.
The Problem
Mac OS security stuff…
The Solution
The solution is on SO. Either answer 1 or 2 will fix this
[ERROR] Source option 1.5 is no longer supported. Use 1.6 or later.
Error Message
[ERROR] Source option 1.5 is no longer supported. Use 1.6 or later.
[ERROR] Target option 1.5 is no longer supported. Use 1.6 or later.
The Solution
Need to set your maven.compiler.source to at least 1.6
<properties>
<maven.compiler.source>1.6</maven.compiler.source>
<maven.compiler.target>1.6</maven.compiler.target>
</properties>
Btw, if you’re struggling with Selenium and need my favorite resources, you might want to check these out.
Cannot start compilation: the output path is not specified for module “xyz” Specify the output path in Configure Project.
Error Message
Cannot start compilation: the output path is not specified for module "xyz" Specify the output path in Configure Project.
The Problem
The issue is that you need to set an output path in your Intelli J.
The Solution
I was able to resolve this problem by setting a path in the Project compiler output. I simply create an `out` folder in my parent directory and specified the path to point to this directory.
Really helpful! Thanks guys
package SSTPageObjects;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.ui.Select;
public class MyprofileObject {
WebDriver driver;
By clickMyprofile = By.xpath(“//a[@href=\”/employee/user\”]”);
By FirstName = By.xpath(“//input[@placeholder=’First Name’]”);
By LastName = By.xpath(“//input[@placeholder=’Last Name’]”);
By Address = By.xpath(“//input[@placeholder=’Home Address’]”);
By City = By.xpath(“//input[@placeholder=’City’]”);
By countryDropdown = By.xpath(“//select[@placeholder=’Country’]”);
By Pincode = By.name(“zipcode”);
By MobileNumber = By.name(“mobile_no”);
By PersonalEmailId = By.xpath(“//input[@name=’personal_email_id’]”);
By ChooseFile = By.xpath(“//*[@id=\”root\”]/div/div[2]/div/div/form/div/div[2]/div[1]/div/div/div[1]/button”);
//By UploadPhoto=By.xpath(“//*[@id=\”root\”]/div/div[2]/div/div/form/div/div[2]/div[1]/div/div/div[1]/button/svg/path”);
By Update=By.xpath(“//button[@type=’submit’]”);
By ClickOnOk=By.xpath(“//button[contains(text(),’OK’)]”);
By ClickOk=By.xpath(“//button[contains(text(),’OK’)]”);
public MyprofileObject(WebDriver driver)
{
this.driver=driver;
}
public WebElement clickMyprofile()
{
return driver.findElement(clickMyprofile);
}
public WebElement FirstName()
{
return driver.findElement(FirstName);
}
public WebElement LastName()
{
return driver.findElement(LastName);
}
public WebElement Address()
{
return driver.findElement(Address);
}
public WebElement City()
{
return driver.findElement(City);
}
public Select getCountryDropdown() {
return new Select(driver.findElement(countryDropdown));
}
public WebElement Pincode()
{
return driver.findElement(Pincode);
}
public WebElement MobileNumber()
{
return driver.findElement(MobileNumber);
}
public WebElement PersonalEmailId()
{
return driver.findElement(PersonalEmailId);
}
public WebElement ChooseFile()
{
return driver.findElement(ChooseFile);
}
public WebElement Update()
{
return driver.findElement(Update);
}
public WebElement ClickOnOk()
{
return driver.findElement(ClickOnOk);
}
public WebElement ClickOk()
{
return driver.findElement(ClickOk);
}
}
This is my object class i want to upload photo here please give me solutions