TestProject Forum

In ChromeDriver class some methods ( findBymethod, navigate) are not found by IDE.. using jdk14. ide says > The method navigate() is undefined for the type ChromeDriver.. but quit() is being shown fine

In ChromeDriver class some methods ( findBymethod, navigate) are not found by IDE… using jdk14…took code from git repo… & pasted,…

package io.testproject.sdk.tests.examples.simple;

import io.testproject.sdk.DriverBuilder;
import io.testproject.sdk.drivers.web.ChromeDriver;

import java.net.URL;

import org.openqa.selenium.By;
import org.openqa.selenium.chrome.ChromeOptions;

public final class WebTest {

public static void main(final String[] args) throws Exception {

// ChromeDriver driver = new ChromeDriver(new ChromeOptions());

    ChromeDriver driver = new DriverBuilder<ChromeDriver>(new ChromeOptions())
  		  .withRemoteAddress(new URL("http://localhost:8585"))
  		  .withToken("MyTokenhere")
  		  .build(ChromeDriver.class);
  
    driver.navigate().to("https://example.testproject.io/web/");
    driver.findElement(By.cssSelector("#name")).sendKeys("John Smith");
    driver.findElement(By.cssSelector("#password")).sendKeys("12345");
    driver.findElement(By.cssSelector("#login")).click();

    boolean passed = driver.findElement(By.cssSelector("#logout")).isDisplayed();
    if (passed) {
        System.out.println("Test Passed");
    } else {
        System.out.println("Test Failed");
    }

    driver.quit();
}

}

Hello @mohammad.d.danish,

Can you please check your Gradle version?
You can do so by navigating to the Gradle wrapper folder in your project, for example, C:\Users\UserName\MyProject\gradle\wrapper and review the distributionUrl.

image

It should be above 6.3, if not, please update your Gradle version by changing the URL like the above screenshot.

Also, can you please share the error message you get in your IDE ?

Hi ,

I am using maven … from mvn repo I downloaded sdk jar… that’s it… I just copied example from test project’s git page… but still not working… see my above code… it’s not abt maven or gradle… it’s abt ChromeDriver’s methods… why navigate & findElement are not found by ide… quit method is found… thanks

Hello @mohammad.d.danish,

Can you please share the pom.xml file? you can send it to our support mail at support@testproject.io


4.0.0
com.testprojectopesdk
TestProjectUpdated
0.0.1-SNAPSHOT

<dependencies>


	<dependency>
		<groupId>io.testproject</groupId>
		<artifactId>java-sdk</artifactId>
		<version>0.65.0-RELEASE</version>
	</dependency>




</dependencies>