I am very new to programming. My main goal is to write code that logs into a android app and does everything that you would have to do with your fingers. So far I’ve only got the app to open, now i’m stuck on entering the login information. I am not familiar with every aspect that has to do with java, eclipse, appium, automation, and selenium, so any help would be greatly appreciated.
Here is my code -
package OpenOfferUpTest;
import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
import org.openqa.selenium.By;
import org.openqa.selenium.Capabilities;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.testng.annotations.Test;
import io.appium.java_client.android.AndroidDriver;
public class OpenOfferUp {
@Test
public void OpensOfferUp() throws MalformedURLException
{
File OfferUp = new File("C:\\Users\\boung\\Desktop\\OfferUp.apk");
DesiredCapabilities cap = new DesiredCapabilities();
cap.setCapability("deviceName", "Virtual Device");
cap.setCapability("platformName", "android");
cap.setCapability("null", "OfferUp");
cap.setCapability("appPackage", "com.offerup");
cap.setCapability("appActivity", "com.offerup.android.login.splash.LoginSplashActivity");
AndroidDriver driver = new AndroidDriver(new URL("http://localhost:4723/wd/hub"), cap);
}
@Test
public void SimpleTest() {
driver.findElement(By.id("com.offerup:id/email_button")).click();
}
}
At driver, it is underlined red, and says that it cannot be resolved. I am not sure on how to fix this.
These are the options I am given -
REMEMBER I am completely new to this, and if you have an answer, I am asking that you describe in detail what the problem is so I know how to fix it next time. If you could actually show me what to do and not just tell me, i’d greatly appreciate it. Thank you.