Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PageFactory.initElements throwing java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkArgument(ZLjava/lang/String;J)V #588

Closed
jaipaddy opened this issue Mar 4, 2017 · 29 comments
Assignees
Labels

Comments

@jaipaddy
Copy link

jaipaddy commented Mar 4, 2017

Description

Trying to get appium to click on my first iOS element in the app. I have set the right desired capabilities since the Appium Desktop is able to open the inspector. But it is throwing -
INFO [IOSAppRegression:55] Step:1 Device: 5s Connecting to Device.......... Exception in thread "main" java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkArgument(ZLjava/lang/String;J)V at io.appium.java_client.pagefactory.TimeOutDuration.setTime(TimeOutDuration.java:54) at io.appium.java_client.pagefactory.TimeOutDuration.setTime(TimeOutDuration.java:59) at io.appium.java_client.pagefactory.TimeOutDuration.<init>(TimeOutDuration.java:37) at io.appium.java_client.pagefactory.AppiumFieldDecorator.<init>(AppiumFieldDecorator.java:80) at ss.qa.test.IOSAppRegression.prepareTestBed(IOSAppRegression.java:85) at ss.qa.test.IOSAppRegression.main(IOSAppRegression.java:165)

Environment

  • java client build version or git revision if you use some shapshot: 5.0.0-BETA4
  • Appium server version or git revision if you use some shapshot: v1.6.4-beta
  • Desktop OS/version used to run Appium if necessary: macOS Sierra
  • Node.js version (unless using Appium.app|exe) or Appium CLI or Appium.app|exe: Appium Desktop app
  • Mobile platform/version under test: iPhone 5s
  • Real device or emulator/simulator: Real device

Details

Gathering all iOS elements on the app to click on.

Code To Reproduce Issue [ Good To Have ]

I have the following set up inside a class -
@iOSFindBy(id = "button_dev") // for iOS native UI private IOSElement dev_button;
and the following initialization for this page -
PageFactory.initElements(new AppiumFieldDecorator(driver, 15, TimeUnit.SECONDS), introScreen);

@mykola-mokhnach
Copy link
Contributor

Possible duplicate of appium/appium#7970

@TikhomirovSergey
Copy link
Contributor

TikhomirovSergey commented Mar 4, 2017

@jaipaddy
Have you upadated your project to Selenium 3.2 or do you use other guava version?
It looks like the common dependency conflict. But I marked this issue as "BUG" because we have the excessive guava dependency. I don't know why. It has being there from...first releases. I think it is more correct to use guava dependency of Selenium. Or use exclusions otherwise.

ping @mykola-mokhnach @SrinivasanTarget

@SrinivasanTarget
Copy link
Member

+1 @TikhomirovSergey

@jaipaddy
Copy link
Author

jaipaddy commented Mar 5, 2017

Upgrading to Selenium 3.2.0 does not compile Pagefactory! Do I need something more in my pom?

     `   <dependency>
		<groupId>io.appium</groupId>
		<artifactId>java-client</artifactId>
		<version>5.0.0-BETA4</version>
		<exclusions>
			<exclusion>
				<groupId>org.seleniumhq.selenium</groupId>
				<artifactId>selenium-java</artifactId>
			</exclusion>
		</exclusions>
	</dependency>
             <dependency>
		<groupId>org.seleniumhq.selenium</groupId>
		<artifactId>selenium-java</artifactId>
		<version>3.2.0</version>
	</dependency>

`

@TikhomirovSergey
Copy link
Contributor

TikhomirovSergey commented Mar 5, 2017

I am going to update dependencies ASAP

@jaipaddy
Copy link
Author

jaipaddy commented Mar 5, 2017

Tried again, but get a similar stacktrace -
org.openqa.selenium.remote.ProtocolHandshake createSession INFO: Detected dialect: OSS Exception in thread "main" java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkArgument(ZLjava/lang/String;Ljava/lang/Object;)V at org.openqa.selenium.remote.http.AbstractHttpCommandCodec.getParameter(AbstractHttpCommandCodec.java:349) at org.openqa.selenium.remote.http.AbstractHttpCommandCodec.buildUri(AbstractHttpCommandCodec.java:334) at org.openqa.selenium.remote.http.AbstractHttpCommandCodec.encode(AbstractHttpCommandCodec.java:223) at org.openqa.selenium.remote.http.AbstractHttpCommandCodec.encode(AbstractHttpCommandCodec.java:118) at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:157) at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:69) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:604) at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:46) at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1) at io.appium.java_client.ios.IOSDriver.execute(IOSDriver.java:1) at io.appium.java_client.HasSessionDetails.getSessionDetails(HasSessionDetails.java:36) at io.appium.java_client.HasSessionDetails.getSessionDetail(HasSessionDetails.java:42) at io.appium.java_client.HasSessionDetails.getPlatformName(HasSessionDetails.java:46) at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:101) at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:113) at io.appium.java_client.ios.IOSDriver.<init>(IOSDriver.java:75) at ss.qa.test.IOSAppRegression.prepareTestBed(IOSAppRegression.java:81) at ss.qa.test.IOSAppRegression.main(IOSAppRegression.java:169)

@TikhomirovSergey
Copy link
Contributor

TikhomirovSergey commented Mar 7, 2017

@jaipaddy I have published 5.0.0-beta5. Could you please try it with this pom configuration

        <dependency>
		<groupId>io.appium</groupId>
		<artifactId>java-client</artifactId>
		<version>5.0.0-BETA5</version>
	</dependency>
        <!--there should not be dependency on selenium-->

@sjenasears
Copy link

i am getting the below error even if i included the latest jar

Java.lang.NoClassDefFoundError: org/openqa/selenium/HasInputDevices
getting this error while running appium script below in eclipse

@before
public void setUp() throws Exception {

DesiredCapabilities capabilities = new DesiredCapabilities();

capabilities.setCapability(MobileCapabilityType.APPIUM_VERSION, "1.6.4-beta");
capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, "iOS");
capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, "10.2");
capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "iPhone 6s");
//capabilities.setCapability(MobileCapabilityType.UDID, "");

//capabilities.setCapability(MobileCapabilityType.APP, "/Users/sjena/Desktop/Relay_Appium/ipa/SYW_Relay.app");
capabilities.setCapability(MobileCapabilityType.APP, "settings");

capabilities.setCapability(IOSMobileCapabilityType.LAUNCH_TIMEOUT, "500000");
capabilities.setCapability(MobileCapabilityType.AUTOMATION_NAME, AutomationName.IOS_XCUI_TEST);
driver = new IOSDriver(new URL("http://0.0.0.0:4723/wd/hub"), capabilities);
driver.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS);

@jaipaddy
Copy link
Author

jaipaddy commented Mar 7, 2017

@TikhomirovSergey Unfortunately, same thing again after removing extra selenium dependencies in my pom.xml-
org.openqa.selenium.remote.ProtocolHandshake createSession INFO: Detected dialect: OSS Exception in thread "main" java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkArgument(ZLjava/lang/String;Ljava/lang/Object;)V at org.openqa.selenium.remote.http.AbstractHttpCommandCodec.getParameter(AbstractHttpCommandCodec.java:349) at org.openqa.selenium.remote.http.AbstractHttpCommandCodec.buildUri(AbstractHttpCommandCodec.java:334) at org.openqa.selenium.remote.http.AbstractHttpCommandCodec.encode(AbstractHttpCommandCodec.java:223) at org.openqa.selenium.remote.http.AbstractHttpCommandCodec.encode(AbstractHttpCommandCodec.java:118) at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:157) at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:69) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:604) at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:46) at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1) at io.appium.java_client.ios.IOSDriver.execute(IOSDriver.java:1) at io.appium.java_client.HasSessionDetails.getSessionDetails(HasSessionDetails.java:36) at io.appium.java_client.HasSessionDetails.getSessionDetail(HasSessionDetails.java:42) at io.appium.java_client.HasSessionDetails.getPlatformName(HasSessionDetails.java:46) at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:101) at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:113) at io.appium.java_client.ios.IOSDriver.<init>(IOSDriver.java:75) at ss.qa.test.IOSAppRegression.prepareTestBed(IOSAppRegression.java:76) at ss.qa.test.IOSAppRegression.main(IOSAppRegression.java:169)

@saikrishna321
Copy link
Member

@TikhomirovSergey get the same error with BETA5

java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkArgument(ZLjava/lang/String;J)V
	at io.appium.java_client.pagefactory.TimeOutDuration.setTime(TimeOutDuration.java:54)
	at io.appium.java_client.pagefactory.TimeOutDuration.setTime(TimeOutDuration.java:59)
	at io.appium.java_client.pagefactory.TimeOutDuration.<init>(TimeOutDuration.java:37)
	at io.appium.java_client.pagefactory.AppiumFieldDecorator.<init>(AppiumFieldDecorator.java:80)
	at io.appium.java_client.pagefactory.AppiumFieldDecorator.<init>(AppiumFieldDecorator.java:149)
	at com.buynow.pages.BasePage.<init>(BasePage.java:44)
	at com.buynow.test.SmokeTest.successPayment(SmokeTest.java:27)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:86)
	at org.testng.internal.Invoker.invokeMethod(Invoker.java:643)
	at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:820)
	at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1128)
	at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:129)
	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:112)
	at org.testng.TestRunner.privateRun(TestRunner.java:782)
	at org.testng.TestRunner.run(TestRunner.java:632)
	at org.testng.SuiteRunner.runTest(SuiteRunner.java:366)
	at org.testng.SuiteRunner.access$000(SuiteRunner.java:39)
	at org.testng.SuiteRunner$SuiteWorker.run(SuiteRunner.java:400)
	at org.testng.internal.thread.ThreadUtil$2.call(ThreadUtil.java:64)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

@indranil-chakraborty
Copy link

I tried running this and I have a similar issue. It seems to come down to a guava bug.

@AlekseiMordas
Copy link

AlekseiMordas commented Mar 22, 2017

Did anybody find working solution?

@saikrishna321
Copy link
Member

#597 this should fix it

@TikhomirovSergey
Copy link
Contributor

Guys. Could you try it on 5.0.0-BETA6? Also could you check your dependencies. I suppose that you projects may depend om older Selenium versions.

@jaipaddy
Copy link
Author

jaipaddy commented Mar 27, 2017

I tried BETA6 and this time it is a different exception -

Exception in thread "main" java.lang.NoSuchMethodError: com.google.common.base.Throwables.throwIfUnchecked(Ljava/lang/Throwable;)V at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:176) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:604) at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:46) at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1) at io.appium.java_client.ios.IOSDriver.execute(IOSDriver.java:1) at io.appium.java_client.HasSessionDetails.getSessionDetails(HasSessionDetails.java:36) at io.appium.java_client.HasSessionDetails.getSessionDetail(HasSessionDetails.java:42) at io.appium.java_client.HasSessionDetails.getPlatformName(HasSessionDetails.java:46) at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:100) at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:112) at io.appium.java_client.ios.IOSDriver.<init>(IOSDriver.java:78) at ss.qa.test.IOSAppRegression.prepareTestBed(IOSAppRegression.java:74) at ss.qa.test.IOSAppRegression.main(IOSAppRegression.java:118)

The only other things in my pom are log4j and testng as in

  <dependencies>
	<dependency>
		<groupId>org.testng</groupId>
		<artifactId>testng</artifactId>
		<version>6.8.7</version>
	</dependency>

	<dependency>
		<groupId>log4j</groupId>
		<artifactId>log4j</artifactId>
		<version>1.2.17</version>
	</dependency>
	
	<dependency>
		<groupId>io.appium</groupId>
		<artifactId>java-client</artifactId>
		<version>5.0.0-BETA6</version>		
	</dependency>
</dependencies>

Kindly test this combination prior to releasing another BETA version.

@SrinivasanTarget
Copy link
Member

@jaipaddy Send me the detailed error logs of both server and client in form of gist. Also what version of server do you use? Code-snippet of what did you tried.

@SrinivasanTarget
Copy link
Member

@jaipaddy Also there is an issue on Selenium latest version, so can you try including java client like below,

        <dependency>
            <groupId>io.appium</groupId>
            <artifactId>java-client</artifactId>
            <version>5.0.0-BETA6</version>
            <exclusions>
                <exclusion>
                        <groupId>com.google.guava</groupId>
                        <artifactId>guava</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>21.0</version>
        </dependency>

@jaipaddy
Copy link
Author

@SrinivasanTarget I am using 1.6.4-beta, I have mentioned that in my first post above. With the pom changes you have mentioned, I get the same client side exception as mentioned eariler and the server has these-

The server is running Start New SessionStop Server [Appium] Welcome to Appium v1.6.4-beta [Appium] Non-default server args: [Appium] address: 'localhost' [Appium] Appium REST http interface listener started on localhost:4723 [XCUITest] Connection to WDA timed out [iProxy] recv failed: Operation not permitted [XCUITest] Connection to WDA timed out [iProxy] recv failed: Operation not permitted [HTTP] --> POST /wd/hub/session {"capabilities":[{"desiredCapabilities":{"app":"/Users/jaipadmanabhan/Downloads/SavingStar-4033.ipa","noReset":true,"appiumVersion":"1.6.4-beta","platformVersion":"10.2","automationName":"XCuiTest","platformName":"iOS","udid":"87df22d04a204b5b5d0d6cdf562e9bf34be0fd3e","deviceName":"iPhone 5s"}},{"requiredCapabilities":{}}],"desiredCapabilities":{"app":"/Users/jaipadmanabhan/Downloads/SavingStar-4033.ipa","noReset":true,"appiumVersion":"1.6.4-beta","platformVersion":"10.2","automationName":"XCuiTest","platformName":"iOS","udid":"87df22d04a204b5b5d0d6cdf562e9bf34be0fd3e","deviceName":"iPhone 5s"},"requiredCapabilities":{}} [MJSONWP] Calling AppiumDriver.createSession() with args: [{"app":"/Users/jaipadmanabhan/Downloads/SavingStar-4033.ipa","noReset":true,"appiumVersion":"1.6.4-beta","platformVersion":"10.2","automationName":"XCuiTest","platformName":"iOS","udid":"87df22d04a204b5b5d0d6cdf562e9bf34be0fd3e","deviceName":"iPhone 5s"},{},[{"desiredCapabilities":{"app":"/Users/jaipadmanabhan/Downloads/SavingStar-4033.ipa","noReset":true,"appiumVersion":"1.6.4-beta","platformVersion":"10.2","automationName":"XCuiTest","platformName":"iOS","udid":"87df22d04a204b5b5d0d6cdf562e9bf34be0fd3e","deviceName":"iPhone 5s"}},{"requiredCapabilities":{}}],null,null] [Appium] Creating new XCUITestDriver (v2.12.1) session [Appium] Capabilities: [Appium] app: '/Users/jaipadmanabhan/Downloads/SavingStar-4033.ipa' [Appium] noReset: true [Appium] appiumVersion: '1.6.4-beta' [Appium] platformVersion: '10.2' [Appium] automationName: 'XCuiTest' [Appium] platformName: 'iOS' [Appium] udid: '87df22d04a204b5b5d0d6cdf562e9bf34be0fd3e' [Appium] deviceName: 'iPhone 5s' [XCUITest] XCUITestDriver version: 2.12.1 [BaseDriver] The following capabilities were provided, but are not recognized by appium: appiumVersion. [BaseDriver] Session created with session id: 82916835-5878-4cfc-88de-07b87a93bb86 [XCUITest] Xcode version set to '8.2.1' [XCUITest] iOS SDK Version set to '10.2' [XCUITest] Available devices: 87df22d04a204b5b5d0d6cdf562e9bf34be0fd3e [XCUITest] Creating iDevice object with udid '87df22d04a204b5b5d0d6cdf562e9bf34be0fd3e' [XCUITest] Determining device to run tests on: udid: '87df22d04a204b5b5d0d6cdf562e9bf34be0fd3e', real device: true [BaseDriver] Using local app '/Users/jaipadmanabhan/Downloads/SavingStar-4033.ipa' [BaseDriver] Copying local zip to tmp dir [BaseDriver] Unzipping /var/folders/f0/stp5z28967v65lqf8yxdfcxm0000gn/T/2017227-93297-1p7gl8d.9vft5ljtt9/appium-app.zip [BaseDriver] Testing zip archive: /var/folders/f0/stp5z28967v65lqf8yxdfcxm0000gn/T/2017227-93297-1p7gl8d.9vft5ljtt9/appium-app.zip [BaseDriver] Unzipped local app to '/var/folders/f0/stp5z28967v65lqf8yxdfcxm0000gn/T/2017227-93297-1p7gl8d.9vft5ljtt9/Payload/SavingStar.app' [XCUITest] Checking whether app '/var/folders/f0/stp5z28967v65lqf8yxdfcxm0000gn/T/2017227-93297-1p7gl8d.9vft5ljtt9/Payload/SavingStar.app' is actually present on file system [XCUITest] App is present [iOS] Getting bundle ID from app '/var/folders/f0/stp5z28967v65lqf8yxdfcxm0000gn/T/2017227-93297-1p7gl8d.9vft5ljtt9/Payload/SavingStar.app': 'com.savewave.SavingStar' [XCUITest] Reset: fullReset not set. Leaving as is [iOSLog] Attempting iOS device log capture via libimobiledevice idevicesyslog [iOSLog] Found idevicesyslog: '/usr/local/bin/idevicesyslog' [XCUITest] Setting up real device [XCUITest] App 'com.savewave.SavingStar' is already installed. No need to reinstall. [XCUITest] Using WDA path: '/Applications/Appium.app/Contents/Resources/app/node_modules/appium-xcuitest-driver/WebDriverAgent' [XCUITest] Using WDA agent: '/Applications/Appium.app/Contents/Resources/app/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj' [XCUITest] Launching WebDriverAgent on the device [XCUITest] Carthage found: '/usr/local/bin/carthage' [XCUITest] Killing hanging processes [XCUITest] xcodebuild exited with code 'null' and signal 'SIGKILL' [XCUITest] iproxy exited with code 'null' [XCUITest] Beginning test with command 'xcodebuild build-for-testing test-without-building -project /Applications/Appium.app/Contents/Resources/app/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination id=87df22d04a204b5b5d0d6cdf562e9bf34be0fd3e -configuration Debug' in directory '/Applications/Appium.app/Contents/Resources/app/node_modules/appium-xcuitest-driver/WebDriverAgent' [XCUITest] Output from xcodebuild will not be logged [XCUITest] Starting iproxy to forward traffic from local port 8100 to device port 8100 over USB [XCUITest] Waiting up to 60000ms for WebDriverAgent to start [XCUITest] WebDriverAgent running on ip '192.168.52.162' [XCUITest] WebDriverAgent successfully started after 996ms [XCUITest] Sending createSession command to WDA [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body [JSONWP Proxy] Got response with status 200: "{\n \"value\" : {\n \"state\" : \"success\",\n \"os\" : {\n \"name\" : \"iOS\",\n \"version\" : \"10.2\"\n },\n \"ios\" : {\n \"simulatorVersion\" : \"10.2\",\n \"ip\" : \"192.168.52.162\"\n },\n \"build\" : {\n \"time\" : \"Mar 3 2017 11:52:17\"\n }\n },\n \"sessionId\" : \"F25A4BE4-4288-453A-B2AC-E7E1BE6E1746\",\n \"status\" : 0\n}" [JSONWP Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"desiredCapabilities":{"bundleId":"com.savewave.SavingStar","arguments":[],"environment":{},"shouldWaitForQuiescence":true}} [XCUITest] Log file for xcodebuild test: /Users/JaiPadmanabhan/Library/Developer/Xcode/DerivedData/WebDriverAgent-cvqckynzuuktkogfpkkkgyompmoj/Logs/Test/A729B560-24D9-4AC0-8E47-C8D8D9F8796C/Session-WebDriverAgentRunner-2017-03-27_142619-K13p80.log [XCUITest] Failed to create WDA session. Retrying... [XCUITest] Sending createSession command to WDA [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body [JSONWP Proxy] Got response with status 200: "{\n \"value\" : {\n \"state\" : \"success\",\n \"os\" : {\n \"name\" : \"iOS\",\n \"version\" : \"10.2\"\n },\n \"ios\" : {\n \"simulatorVersion\" : \"10.2\",\n \"ip\" : \"192.168.52.162\"\n },\n \"build\" : {\n \"time\" : \"Mar 3 2017 11:52:17\"\n }\n },\n \"sessionId\" : \"E485C8D9-E7EB-480F-B278-99577C6FC89A\",\n \"status\" : 0\n}" [JSONWP Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"desiredCapabilities":{"bundleId":"com.savewave.SavingStar","arguments":[],"environment":{},"shouldWaitForQuiescence":true}} [JSONWP Proxy] Got response with status 200: {"value":{"sessionId":"5E2D7C02-8F6E-4BF4-80AC-2F9C8A7A7B55","capabilities":{"device":"iphone","browserName":"SavingStar","sdkVersion":"10.2","CFBundleIdentifier":"com.savewave.SavingStar"}},"sessionId":"5E2D7C02-8F6E-4BF4-80AC-2F9C8A7A7B55","status":0} [XCUITest] Found WDA derived data folder: '/Users/JaiPadmanabhan/Library/Developer/Xcode/DerivedData/WebDriverAgent-cvqckynzuuktkogfpkkkgyompmoj' [XCUITest] Setting '555' permissions to '/Users/JaiPadmanabhan/Library/Developer/Xcode/DerivedData/WebDriverAgent-cvqckynzuuktkogfpkkkgyompmoj/Logs/Test/Attachments' folder [XCUITest] Setting initial orientation to 'PORTRAIT' [JSONWP Proxy] Proxying [POST /orientation] to [POST http://localhost:8100/session/5E2D7C02-8F6E-4BF4-80AC-2F9C8A7A7B55/orientation] with body: {"orientation":"PORTRAIT"} [JSONWP Proxy] Got response with status 200: {"value":{},"sessionId":"5E2D7C02-8F6E-4BF4-80AC-2F9C8A7A7B55","status":0} [Appium] New XCUITestDriver session created successfully, session 82916835-5878-4cfc-88de-07b87a93bb86 added to master session list [MJSONWP] Responding to client with driver.createSession() result: {"webStorageEnabled":false,"locationContextEnabled":false,"browserName":"","platform":"MAC","javascriptEnabled":true,"databaseEnabled":false,"takesScreenshot":true,"networkConnectionEnabled":false,"app":"/Users/jaipadmanabhan/Downloads/SavingStar-4033.ipa","noReset":true,"appiumVersion":"1.6.4-beta","platformVersion":"10.2","automationName":"XCuiTest","platformName":"iOS","udid":"87df22d04a204b5b5d0d6cdf562e9bf34be0fd3e","deviceName":"iPhone 5s"} [HTTP] <-- POST /wd/hub/session 200 18572 ms - 522 [BaseDriver] Shutting down because we waited 60 seconds for a command [XCUITest] Shutting down sub-processes [Appium] Closing session, cause was 'New Command Timeout of 60 seconds expired. Try customizing the timeout using the 'newCommandTimeout' desired capability' [Appium] Removing session 10aeefd0-15cb-4a00-b241-1496c0d655fe from our master session list [XCUITest] Found WDA derived data folder: '/Users/JaiPadmanabhan/Library/Developer/Xcode/DerivedData/WebDriverAgent-cvqckynzuuktkogfpkkkgyompmoj' [XCUITest] Setting '755' permissions to '/Users/JaiPadmanabhan/Library/Developer/Xcode/DerivedData/WebDriverAgent-cvqckynzuuktkogfpkkkgyompmoj/Logs/Test/Attachments' folder [iOSLog] Stopping iOS log capture

Hope this helps?

@SrinivasanTarget
Copy link
Member

@jaipaddy Latest changes works perfectly fine for me. I wasn't able to replicate the issue. Can you send me the actual code snippet with all the desired caps you are trying. Also it would be good if you could send me the logs inform of gist. would be great help if you could help me in replicating.

@TikhomirovSergey
Copy link
Contributor

TikhomirovSergey commented Mar 28, 2017

@jaipaddy Have you tried to update testg?
I was trying to chech dependencies.
https://mvnrepository.com/artifact/org.testng/testng/6.8.7
The latest is
https://mvnrepository.com/artifact/org.testng/testng/6.11

There are some google dependencies

@jaipaddy
Copy link
Author

@TikhomirovSergey Upgrade to testng 6.11 doesn't seem to help here. @SrinivasanTarget gist is here https://gist.github.com/jaipaddy/323061a7875b1318376a2b3538077d2a

It throws during instantiating IOSDriver; however the app is launched on the iOS device.

@aaronmagi
Copy link

We are also running into this with
Appium java client 5.0.0-BETA7
selenium-server 3.3.1
selenium-remote-driver 3.3.1
selenium-android-driver 2.39
Appium 1.6.4
TestNG 6.10

@mykola-mokhnach
Copy link
Contributor

Try to update google guava in your pom.xml:

<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>21.0</version>

@vikramvi
Copy link

with appium server 1.6.6-beta3 + 5.0.0-BETA9, was getting below error at android driver creation step.

Any idea why this weird error message ?

The issue got solved with below entries

      **<dependency>
        <groupId>io.appium</groupId>
        <artifactId>java-client</artifactId>
        <version>5.0.0-BETA9</version>
        <exclusions>
            <exclusion>
                    <groupId>com.google.guava</groupId>
                    <artifactId>guava</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>com.google.guava</groupId>
        <artifactId>guava</artifactId>
        <version>21.0</version>
    </dependency>**
java.lang.NoSuchMethodError: com.google.common.base.Throwables.throwIfUnchecked(Ljava/lang/Throwable;)V
	at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:176)
	at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:644)
	at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:42)
	at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
	at io.appium.java_client.android.AndroidDriver.execute(AndroidDriver.java:1)
	at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:249)
	at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:131)
	at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:144)
	at io.appium.java_client.DefaultGenericMobileDriver.<init>(DefaultGenericMobileDriver.java:38)
	at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:88)
	at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:112)
	at io.appium.java_client.android.AndroidDriver.<init>(AndroidDriver.java:73)
	at com.serenity.appium.poc.test_classes.AppiumSingleDeviceTest.setup(AppiumSingleDeviceTest.java:35)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:85)
	at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:510)
	at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:211)
	at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:138)
	at org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:170)
	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:104)
	at org.testng.TestRunner.privateRun(TestRunner.java:774)
	at org.testng.TestRunner.run(TestRunner.java:624)
	at org.testng.SuiteRunner.runTest(SuiteRunner.java:359)
	at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:354)
	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:312)
	at org.testng.SuiteRunner.run(SuiteRunner.java:261)
	at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
	at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
	at org.testng.TestNG.runSuitesSequentially(TestNG.java:1191)
	at org.testng.TestNG.runSuitesLocally(TestNG.java:1116)
	at org.testng.TestNG.run(TestNG.java:1024)
	at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:132)
	at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:236)
	at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:81)

@SrinivasanTarget
Copy link
Member

@vikramvi Its a dependency conflict issue which we are aware of, which is being rectified in latest Selenium version released couple of days back.

@TikhomirovSergey
Copy link
Contributor

It seems we found the rootcause. #714

@ritesh2689
Copy link

ritesh2689 commented Oct 16, 2017

Getting this issue
java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkArgument(ZLjava/lang/String;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)V
at org.openqa.selenium.firefox.Preferences.checkPreference(Preferences.java:224)
at org.openqa.selenium.firefox.Preferences.setPreference(Preferences.java:154)
at org.openqa.selenium.firefox.Preferences.setPreference(Preferences.java:125)
at org.openqa.selenium.firefox.Preferences.readDefaultPreferences(Preferences.java:104)
at org.openqa.selenium.firefox.Preferences.(Preferences.java:65)
at org.openqa.selenium.firefox.FirefoxProfile.(FirefoxProfile.java:81)
at org.openqa.selenium.firefox.FirefoxProfile.(FirefoxProfile.java:71)
at org.openqa.selenium.firefox.FirefoxProfile.(FirefoxProfile.java:60)
at org.openqa.selenium.firefox.FirefoxDriver.toExecutor(FirefoxDriver.java:139)
at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:120)
at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:98)
at com.snapdeal.payments.qe.checkout.configuration.DriverFactory.setDriver(DriverFactory.java:185)
at com.snapdeal.payments.qe.checkout.configuration.DriverFactory.setDriver(DriverFactory.java:174)
at com.snapdeal.payments.qe.checkout.utils.TestBase.beforeTest(TestBase.java:437)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:85)
at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:552)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:215)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:636)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:882)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1189)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:124)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:108)
at org.testng.TestRunner.privateRun(TestRunner.java:767)
at org.testng.TestRunner.run(TestRunner.java:617)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:348)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:343)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:305)
at org.testng.SuiteRunner.run(SuiteRunner.java:254)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)
at org.testng.TestNG.run(TestNG.java:1057)
at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:132)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:230)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:76)

Using below dependencies in pom.xml

org.seleniumhq.selenium
selenium-chrome-driver
3.6.0

	<dependency>
		<groupId>org.seleniumhq.selenium</groupId>
		<artifactId>selenium-ie-driver</artifactId>
		<version>3.6.0</version>
	</dependency>
org.seleniumhq.selenium selenium-java 3.6.0 org.seleniumhq.selenium selenium-firefox-driver 3.6.0 org.seleniumhq.selenium selenium-api 3.6.0 org.seleniumhq.selenium selenium-server 3.6.0 javax.servlet servlet-api com.google.guava guava 21.0 org.seleniumhq.selenium htmlunit-driver 2.27 org.testng testng 6.11 test

@sudoManju
Copy link

sudoManju commented Mar 11, 2018

I'm getting this error:
java.lang.RuntimeException: java.lang.InstantiationException: pages.Pages
at org.openqa.selenium.support.PageFactory.instantiatePage(PageFactory.java:136)
at org.openqa.selenium.support.PageFactory.initElements(PageFactory.java:66)
at steps.PageStore.get(PageStore.java:25)
at steps.AppiumSteps.lambda$new$0(AppiumSteps.java:17)
at ✽.Given mobile able to open browser(D:/Repositories/mobileAutomation/src/test/resources/features/firstAppium.feature:4)
Caused by: java.lang.InstantiationException: pages.Pages
at java.lang.Class.newInstance(Class.java:427)
at org.openqa.selenium.support.PageFactory.instantiatePage(PageFactory.java:133)
at org.openqa.selenium.support.PageFactory.initElements(PageFactory.java:66)
at steps.PageStore.get(PageStore.java:25)
at steps.AppiumSteps.lambda$new$0(AppiumSteps.java:17)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at cucumber.runtime.Utils$1.call(Utils.java:40)
at cucumber.runtime.Timeout.timeout(Timeout.java:16)
at cucumber.runtime.Utils.invoke(Utils.java:34)
at cucumber.runtime.java.Java8StepDefinition.execute(Java8StepDefinition.java:115)
at cucumber.runtime.StepDefinitionMatch.runStep(StepDefinitionMatch.java:37)
at cucumber.runtime.Runtime.runStep(Runtime.java:300)
at cucumber.runtime.model.StepContainer.runStep(StepContainer.java:44)
at cucumber.runtime.model.StepContainer.runSteps(StepContainer.java:39)
at cucumber.runtime.model.CucumberScenario.run(CucumberScenario.java:44)
at cucumber.runtime.model.CucumberFeature.run(CucumberFeature.java:165)
at cucumber.runtime.Runtime.run(Runtime.java:122)
at cucumber.api.cli.Main.run(Main.java:36)
at cucumber.api.cli.Main.main(Main.java:18)
Caused by: java.lang.NoSuchMethodException: pages.Pages.()
at java.lang.Class.getConstructor0(Class.java:3082)
at java.lang.Class.newInstance(Class.java:412)
... 21 more

@Shrikant2612
Copy link

Hi Team,
Please help me out i am facing same issue..

java.lang.NoSuchMethodError: com.google.common.base.Throwables.throwIfUnchecked(Ljava/lang/Throwable;)V
at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:176)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests