TestProject Forum
Powered by leading experts in the test automation community

Testproject-sdk.properties file was not found. Assuming SDK version 0.45.7-42-gfccd6f3

I have created a Maven project. and on trying to upload jar i see below issues.
Note : Am attaching jar which is created via Maven, +POM+Descriptor + code which i am using.

Jar file, POM and Descriptor file Path: https://drive.google.com/file/d/1W_nThmf9VIW3xnWnA8dhkXmqH9nRmjGw/view?usp=sharing

CODE

Main Test:

package mainScript;

import io.testproject.java.sdk.v2.drivers.AndroidDriver;
import io.testproject.java.sdk.v2.enums.ExecutionResult;
import io.testproject.java.sdk.v2.exceptions.FailureException;
import io.testproject.java.sdk.v2.tests.AndroidTest;
import io.testproject.java.sdk.v2.tests.helpers.AndroidTestHelper;
import pages.NewMessagePage;

public class MainTest implements AndroidTest {

public ExecutionResult execute(AndroidTestHelper helper) throws FailureException {
	AndroidDriver driver = helper.getDriver();
	NewMessagePage newMSG = new NewMessagePage(driver);
	
	newMSG.selectNewMsg();
	newMSG.enterNumber();
	newMSG.enterText();
	newMSG.sendMsg();

	return ExecutionResult.PASSED;
}

}


page:

package pages;

import org.openqa.selenium.support.FindBy;

import io.appium.java_client.android.AndroidElement;
import io.appium.java_client.android.nativekey.AndroidKey;
import io.appium.java_client.android.nativekey.KeyEvent;
import io.testproject.java.sdk.v2.drivers.AndroidDriver;
import io.testproject.java.sdk.v2.support.PageFactory;

public class NewMessagePage {

AndroidDriver driver;

@FindBy(id=“com.android.mms:id/start_new_conversation_button”)
private AndroidElement composeMsg;

@FindBy(id=“com.android.mms:id/recipients_editor”)
private AndroidElement enterNumber;

@FindBy(xpath="//android.widget.EditText[contains(@text,‘Text message’)]")
private AndroidElement enterText;

@FindBy(id=“com.android.mms:id/send_button_sms”)
private AndroidElement sendMsg;

public void selectNewMsg() {
driver.pressKey(new KeyEvent(AndroidKey.MENU));
composeMsg.click();
}

public void enterNumber() {
enterNumber.sendKeys(“8861715105”);
}

public void enterText() {
enterText.sendKeys(“This is TestProject”);
}

public void sendMsg() {
driver.pressKey(new KeyEvent(AndroidKey.MENU));
sendMsg.click();
}

public NewMessagePage(AndroidDriver driverMain) {
PageFactory.initElements(driverMain, this);
}
}


Thanks,
Akshay Soni

Hi Akshay.
Try, please, to do next:

Create this file : “testproject-sdk.properties”
With next content without quotation marks “version=0.58.0”

Then open your jar file and place this file inside it.
It should resolve this error message.
Version, pointed in .properties file should equals the version of SDK that you are used in your code.

Hi Vladyslav,
I have tried, Still i see the same issue.

Also, i could see in descriptor.xml below properties file. Question here is why it is not unpacking it

image

while generating jar via maven i see below warnings. is this causing issue?

[WARNING] Some problems were encountered while building the effective model for groupId:AppTestProject:jar:1.0-SNAPSHOT
[WARNING] ‘dependencies.dependency.systemPath’ for io.testproject:java-sdk:jar should use a variable instead of a hard-coded path D:/0.Automation/TestProject_SDK_0.58.0.jar @ line 54, column 25

Hi Akshay. Most apparently it relevant to how the pom.xml built.
Is there any chance you can migrate this from Maven to Gradle?

Vlad, Sure i will do it in gradel, meanwhile could you please help me in below queries

Question 1: can you please explain me below output lines. what actually it is downloading?

[INFO] — maven-assembly-plugin:2.2-beta-5:single (make-assembly) @ AppTestProject —
[INFO] Reading assembly descriptor: src/test/java/descriptor.xml
[INFO] Downloading from : https://repo.maven.apache.org/maven2/io/testproject/java-sdk/1.0/java-sdk-1.0.pom

Question 2 : in below code do i need to change version from 1.0 to 0.58.0 ? as my java-sdk downloaded from testproject site is 0.58.0.

    <dependency>
        <groupId>io.testproject</groupId>
        <artifactId>java-sdk</artifactId>
        <version>1.0</version>
        <!-- Update the location of the sdk as required -->
        <systemPath>${tp.sdk.path}</systemPath>
        <scope>system</scope> <!-- Local file won't be assembled by maven-assembly-plugin -->
    </dependency>

I have used gradel now and i dont see Properties file issue… but still on loading jar file in testproject it shows requires 0.58.0 SDK

i have shared jar file created via gradle in below path:

Note:
I dont see any issue while running through agent locally via runner.

Question:
In sample gradel code “https://github.com/testproject-io/java-sdk-examples/blob/master/Android/Test/build.gradle

In below dependency i have commented “compile line” while making of jar as it was not allowing to build jar . Do i need to add something else here?

dependencies {
tpsdk files("${TP_SDK}")
// compile files(‘src/main/proxy/android-example-addon.proxy.jar’)

testCompile 'org.junit.jupiter:junit-jupiter-api:5.3.1'
testRuntime 'org.junit.platform:junit-platform-runner:1.3.1'
testRuntime 'org.junit.jupiter:junit-jupiter-engine:5.3.1'
testRuntime 'org.junit.vintage:junit-vintage-engine:5.3.1'

}