Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

For me not getting how to navigate the once the app was login and home page is displayed but for me not getting how to navigate home page to another page

未关闭
#2,198 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 5 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
15/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
停滞
技术栈
android, java
领域
mobile, testing-qa

调研方向

报告提供了名为 Basetest、SplashActivity 和 Eventtest 的 Java 测试类,这些类使用 Android 应用和位于 http://127.0.0.1:4723/wd/hub 的 Appium 服务器。首先从显示的主页开始复现导航,但未提供任何仓库文件、失败的测试、预期行为或完成标准。

由索引模型根据 Issue 内容生成。

描述

bug
Do I have the most recent component updates?
  • I use the most recent available driver/plugin and server versions
Is the component officially supported by the Appium team?
  • I have verified the component repository is present under the Appium organization in GitHub
Is there an existing issue for this?
  • I have searched the existing issues
Current Behavior

I have written base test code like this
package Daakia.Virtualdevice;

import java.net.MalformedURLException;
import java.net.URL;
import java.time.Duration;

import org.openqa.selenium.remote.DesiredCapabilities;
import org.testng.Assert;
import org.testng.annotations.BeforeClass;

import io.appium.java_client.android.AndroidDriver;

import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import io.appium.java_client.MobileElement;

public class Basetest {
public static AndroidDriver driver;

 @BeforeClass
    public void ConfigureAppium() {
	 
        DesiredCapabilities capabilities = new DesiredCapabilities();
        capabilities.setCapability("deviceName", "darshan");
        capabilities.setCapability("platformName", "Android");
        capabilities.setCapability("app", "C:\\apk\\Daakia-17.0-prod-release.apk");
        capabilities.setCapability("automationName", "UiAutomator2");
        capabilities.setCapability("appPackage", "com.app.daakia");
       capabilities.setCapability("appActivity", "com.daakia.ui.CreateEventActivity");
       capabilities.setCapability("newCommandTimeout", 300);
       capabilities.setCapability("adbExecTimeout", 120000);
       capabilities.setCapability("uiautomator2ServerLaunchTimeout", 120000);
     //   capabilities.setCapability("appActivity", "com.daakia.ui.ConversationActivity");

        try {
            URL url = new URL("http://127.0.0.1:4723/wd/hub");
            driver = new AndroidDriver(url, capabilities);
        } catch (MalformedURLException e) {
            e.printStackTrace();
        }
    }
 public void navigateToOtherTab() throws InterruptedException {
        // Wait for the home screen to load
        WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(30));
        WebElement homeScreenElement = wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("com.app.daakia:id/navigation_bar_item_large_label_view")));
        homeScreenElement.click();


        // Click on the tab to navigate to it
        WebElement eventsTabElement = wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("com.app.daakia:id/navigation_bar_item_icon_view")));   	
        		
        eventsTabElement.click();
 }

}

I have written code for SplashActivity page

package Daakia.Virtualdevice;

import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

import java.time.Duration;
import java.util.concurrent.TimeUnit;

import org.testng.Assert;

import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.ui.WebDriverWait;

import io.appium.java_client.AppiumBy;
import io.appium.java_client.MobileElement;

public class SplashActivity extends Basetest{

@BeforeClass
public void setUp() {
	DesiredCapabilities capabilities = new DesiredCapabilities();
	capabilities.setCapability("appPackage", "com.app.daakia");
    capabilities.setCapability("appActivity", "com.daakia.ui.SplashActivity");
    
}

@Test
public void testSplashScreen() throws InterruptedException  {
	 //   driver.findElement(By.id("com.app.daakia:id/fabWelcome")).click();
    //  Thread.sleep(4000);
    //  driver.findElement(By.id("com.app.daakia:id/primary_button")).click();
    //  Thread.sleep(2000);
    //  driver.findElement(By.id("com.app.daakia:id/fabWelcome")).click();
  //    Thread.sleep(6000);
  //  driver.findElement(By.id("com.app.daakia:id/primary_button")).click();
   //   driver.findElement(By.id("com.app.daakia:id/fabWelcome")).click();
    //  Thread.sleep(2000);
   //   driver.findElement(By.id("com.app.daakia:id/fabWelcome")).click();
   //   Thread.sleep(2000);
     driver.findElement(By.id("com.app.daakia:id/txtSkip")).click();    	
      Thread.sleep(4000);
      driver.findElement(By.id("com.app.daakia:id/tvContinueNow")).click();
      Thread.sleep(2000);
      driver.findElement(By.id("com.android.permissioncontroller:id/permission_allow_button")).click();
     Thread.sleep(2000);
     
   //    driver.findElement(By.id("com.app.daakia:id/primary_button")).click();
      driver.findElement(By.id("com.app.daakia:id/btnStartChat")).click();
      Thread.sleep(2000);
      driver.findElement(By.id("com.app.daakia:id/editTextPhoneNumber")).sendKeys("8686868686");
     
      Thread.sleep(1000);
      driver.findElement(By.id("com.app.daakia:id/txtPrivacyCheckbox")).click();
      Thread.sleep(1000);
 //     driver.findElement(By.id("com.app.daakia:id/buttonNext")).click();
 //     driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
      WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(120));
      WebElement buttonNext = wait.until(ExpectedConditions.elementToBeClickable(By.id("com.app.daakia:id/buttonNext")));
      buttonNext.click();
  //  driver.manage().timeouts().implicitlyWait(driver, Duration.ofSeconds(10));
   //   driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(10));
      WebDriverWait wait1 = new WebDriverWait(driver, Duration.ofSeconds(120));
      WebElement otpViewElement = wait1.until(ExpectedConditions.visibilityOfElementLocated(By.id("com.app.daakia:id/otpView")));
      otpViewElement.sendKeys("555555");
      Thread.sleep(8000);
   
      
     driver.findElement(By.id("com.app.daakia:id/editTextLaunguage")).click();
      Thread.sleep(4000);
      driver.findElement(By.id("com.app.daakia:id/edtSearch")).sendKeys("kannada");
      Thread.sleep(2000);
      driver.findElement(By.id("com.app.daakia:id/radioLanguage")).click();
      Thread.sleep(2000);
 
      WebDriverWait wait2 = new WebDriverWait(driver, Duration.ofSeconds(120));
      WebElement buttonNext1 = wait.until(ExpectedConditions.elementToBeClickable(By.id("com.app.daakia:id/buttonFinish")));
      buttonNext1.click();
   //   driver.findElement(By.id("com.app.daakia:id/buttonFinish")).click();
   //   Thread.sleep(10000);
  //    driver.findElement(By.id("com.app.daakia:id/skip")).click();
      Thread.sleep(10000);
      driver.findElement(By.id("com.app.daakia:id/tvGotIt")).click();    	
  	
      
      Thread.sleep(4000);
      driver.findElement(By.id("com.app.daakia:id/tvGotIt")).click();
      Thread.sleep(4000);
      driver.findElement(By.id("com.app.daakia:id/tvGotIt")).click();
      Thread.sleep(4000);
      driver.findElement(By.id("android:id/button2")).click();
      Thread.sleep(2000);
	 navigateToOtherTab();
}
	 
	 public void navigateToOtherTab() throws InterruptedException {
	       
	        WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(30));
	        WebElement homeScreenElement = wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("(//android.widget.FrameLayout[@content-desc=\\\"Chats\\\"])")));
	        homeScreenElement.click();

	        driver.findElement(By.xpath("(//android.widget.FrameLayout[@content-desc=\\\"Events\\\"])")).click(); // Replace with actual tab ID
	        

}

}

I have written code for event page

package Daakia.Virtualdevice;

import io.appium.java_client.android.AndroidDriver;
import io.appium.java_client.remote.AndroidMobileCapabilityType;
import io.appium.java_client.remote.MobileCapabilityType;

import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
import org.testng.annotations.Test;

import java.net.MalformedURLException;
import java.net.URL;
import java.time.Duration;

public class Eventtest extends SplashActivity{
public static void main(String[] args) throws MalformedURLException {
DesiredCapabilities caps = new DesiredCapabilities();
caps.setCapability(MobileCapabilityType.PLATFORM_NAME, "Android");
caps.setCapability(MobileCapabilityType.DEVICE_NAME, "darshan");
caps.setCapability(MobileCapabilityType.APP, "C:\apk\Daakia-17.0-prod-release.apk");
caps.setCapability(AndroidMobileCapabilityType.APP_ACTIVITY, "com.daakia.ui.CreateEventActivity");
caps.setCapability(AndroidMobileCapabilityType.APP_PACKAGE, "com.app.daakia");

        // Initialize the driver
        try {
            URL url = new URL("http://127.0.0.1:4723/wd/hub");
            driver = new AndroidDriver(url, caps);
        } catch (MalformedURLException e) {
            e.printStackTrace();
        }
 }

        @Test
    	public void EventTest() throws MalformedURLException, InterruptedException 
    	{
	        WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(30));
	        WebElement startDaakButton = wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("com.app.daakia:id/fabOpenChat")));
	        startDaakButton.click();
    //		driver.findElement(By.id("com.app.daakia:id/eventsFragment")).click(); 
    //        Thread.sleep(2000);
    //        driver.findElement(By.id("com.app.daakia:id/fabOpenChat")).click(); 
    //        Thread.sleep(2000);
            driver.findElement(By.id("com.app.daakia:id/eventNameEt")).sendKeys("Testing 1");
            Thread.sleep(2000);
            driver.findElement(By.id("com.app.daakia:id/hostNameEt")).sendKeys("darshan");   	
            Thread.sleep(2000);
            driver.findElement(By.id("com.app.daakia:id/topicEt")).sendKeys("QA Testing");
            Thread.sleep(2000);
            driver.findElement(By.id("com.app.daakia:id/dateFromEtTv")).click();
            Thread.sleep(2000);
            driver.findElement(By.xpath("(//android.view.View[@content-desc=\"09 July 2024\"])")).click();
            Thread.sleep(2000);
            driver.findElement(By.id("android:id/button1")).click();
            Thread.sleep(2000);
           
            driver.findElement(By.id("com.app.daakia:id/dateToEtTv")).click();   	
            Thread.sleep(2000);
            
            driver.findElement(By.xpath("(//android.widget.RadialTimePickerView.RadialPickerTouchHelper[@content-desc=\"13\"])")).click();
       //     Thread.sleep(2000);
       //     driver.findElement(By.id("android:id/minutes")).click();
            Thread.sleep(2000);
            driver.findElement(By.xpath("(//android.widget.RadialTimePickerView.RadialPickerTouchHelper[@content-desc=\"50\"])")).click();     	
          
            Thread.sleep(2000);
            driver.findElement(By.id("android:id/button1")).click();
            Thread.sleep(2000);
            driver.findElement(By.id("com.app.daakia:id/addParticipantEt")).click();  
            Thread.sleep(2000);
            driver.findElement(By.id("com.app.daakia:id/emailET")).sendKeys("[email protected]"); 
            Thread.sleep(2000);
            driver.findElement(By.id("com.app.daakia:id/submit")).click();
            Thread.sleep(2000);
            driver.findElement(By.id("com.app.daakia:id/buttonCreate")).click();
            Thread.sleep(2000);
            driver.findElement(By.id("com.android.permissioncontroller:id/permission_allow_button")).click();
            Thread.sleep(2000);
            driver.findElement(By.id("com.google.android.gms:id/account_name")).click();
            Thread.sleep(6000);
            driver.findElement(By.xpath("(//android.widget.ImageButton[@content-desc=\"Navigate up\"])"));   
          
        driver.quit();
    }
}
Expected Behavior

Like this error is getting

Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: An unknown server-side error occurred while processing the command. Original error: Cannot start the 'com.app.daakia' application. Visit https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/android/activity-startup.md for troubleshooting. Original error: Error executing adbExec. Original error: 'Command ''C:\Users\Dashan K N\AppData\Local\Android\Sdk\platform-tools\adb.exe' -P 5037 -s emulator-5554 shell am start -W -n com.app.daakia/com.daakia.ui.CreateEventActivity -S -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000' exited with code 255'; Command output:
Exception occurred while executing 'start':
java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.app.daakia/com.daakia.ui.CreateEventActivity } from null (pid=4281, uid=2000) not exported from uid 10157
at com.android.server.wm.ActivityTaskSupervisor.checkStartAnyActivityPermission(ActivityTaskSupervisor.java:1059)
at com.android.server.wm.ActivityStarter.executeRequest(ActivityStarter.java:983)
at com.android.server.wm.ActivityStarter.execute(ActivityStarter.java:672)
at com.android.server.wm.ActivityTaskManagerService.startActivityAndWait(ActivityTaskManagerService.java:1493)
at com.android.server.am.ActivityManagerService.startActivityAndWait(ActivityManagerService.java:2975)
at com.android.server.am.ActivityManagerShellCommand.runStartActivity(ActivityManagerShellCommand.java:567)
at com.android.server.am.ActivityManagerShellCommand.onCommand(ActivityManagerShellCommand.java:201)
at com.android.modules.utils.BasicShellCommandHandler.exec(BasicShellCommandHandler.java:97)
at android.os.ShellCommand.exec(ShellCommand.java:38)
at com.android.server.am.ActivityManagerService.onShellCommand(ActivityManagerService.java:8738)
at android.os.Binder.shellCommand(Binder.java:950)
at android.os.Binder.onTransact(Binder.java:834)
at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:5167)
at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2517)
at android.os.Binder.execTransactInternal(Binder.java:1184)
at android.os.Binder.execTransact(Binder.java:1143)

Host info: host: 'DESKTOP-IOI875F', ip: '172.31.48.1'
Build info: version: '4.8.0', revision: '267030adea'
System info: os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '17.0.6'
Driver info: io.appium.java_client.android.AndroidDriver
Command: [null, newSession {capabilities=[{appium:app=C:\apk\Daakia-17.0-prod-release.apk, appium:appActivity=com.daakia.ui.CreateEventActivity, appium:appPackage=com.app.daakia, appium:deviceName=darshan, platformName=ANDROID}], desiredCapabilities=Capabilities {app: C:\apk\Daakia-17.0-prod-rel..., appActivity: com.daakia.ui.CreateEventAc..., appPackage: com.app.daakia, deviceName: darshan, platformName: ANDROID}}]
Capabilities {}
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:148)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at io.appium.java_client.remote.AppiumProtocolHandshake.createSession(AppiumProtocolHandshake.java:133)
at io.appium.java_client.remote.AppiumProtocolHandshake.createSession(AppiumProtocolHandshake.java:102)
at io.appium.java_client.remote.AppiumCommandExecutor.createSession(AppiumCommandExecutor.java:182)
at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:250)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:543)
at io.appium.java_client.AppiumDriver.startSession(AppiumDriver.java:274)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:157)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:89)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:101)
at io.appium.java_client.android.AndroidDriver.(AndroidDriver.java:113)
at Daakia.Virtualdevice.Eventtest.main(Eventtest.java:30)

Minimal Reproducible Example

Please give the solution for this error how to navigate home page to other page

Environment
  • Operating system:
  • Appium server version (output of appium --version):
  • Appium driver(s) and their version(s) (appium driver list):
  • Appium plugin(s) and their version(s) (appium plugin list):
  • Node.js version (output of node --version):
  • npm version (output of npm --version):
  • Last component(s) version which did not exhibit the problem:
  • Platform and version under test:
  • Real device or emulator/simulator:
Link to Appium Logs

No response

Further Information

No response

主要语言
Java
星标
1.3k
派生
755
平均合并
5 天 14 小时
30 天内合并 PR
8

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 有 Pull Request 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

appium/java-client 的其他 Issue

查看 appium/java-client 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。