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

appium_console unable to call a remote server #303

Closed
lnnp1910 opened this issue Feb 2, 2015 · 6 comments
Closed

appium_console unable to call a remote server #303

lnnp1910 opened this issue Feb 2, 2015 · 6 comments

Comments

@lnnp1910
Copy link

lnnp1910 commented Feb 2, 2015

Hello,

I'm trying to use arc appium_consle to call a remote appium server with a different ip address than 127.0.0.1, but it doesn't work.

It works well when I launch my appium server on http://127.0.0.1:4723/wb/hub/. 'arc' starts the console with no issue. Here is my appium.txt:
[caps]
platformName = "ios"
device = "iPhone5"
platformVersion = "7.0.4"

When I switch the appium server to a remote ip such as http://10.0.3.61:4723/wb/hub". I also add this to appium.txt:

[appium_lib]
server_url = "http://10.0.3.61:4723/wb/hub/"

I receives the error indicating that "That URL did not map to a valid JSONWP resource". On the appium server's log: responding to client that we did not find a valid resource 404 error. Also tried with "custom_url="

Any helps?

@bootstraponline
Copy link
Member

server_url = is the correct way to change the server address. I recommend writing a stand alone script in any language and try to get it working. Once it works then it's simple to use the same values for your appium.txt. As far as I can tell, this is user error and the server info isn't accurate.

@lnnp1910
Copy link
Author

lnnp1910 commented Feb 3, 2015

I wrote one python client script to initialize an appium session and do some ui navigation with no issue (this is with the remote server given an ip address). With arc, things work just fine if I use the localhost. But once switching to server_url, then it keeps giving me that error of "That URL did not map to a valid JSONWP resource".

I don't think there's something wrong with my caps because using the same caps, it works well on local ip address.
Please help :(

@bootstraponline
Copy link
Member

Post the appium server logs for arc & python as a gist. It's unlikely the caps are the same.

@bootstraponline
Copy link
Member

13 days without a response. It's working for me & other users so unless there are logs, it's difficult to debug.

@danubiapaiva
Copy link

Não estou conseguindo resolver um erro parecido.

org.openqa.selenium.SessionNotCreatedException: Unable to create new remote session. desired capabilities = Capabilities [{app=d:\automacao\Banestes.apk, platformName=Android, deviceName=Android Emulator}], required capabilities = Capabilities [{}]
Build info: version: '3.0.1', revision: '1969d75', time: '2016-10-18 09:48:19 -0700'
System info: host: 'DESKTOP-T3J392Q', ip: '192.168.105.2', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_121'
Driver info: driver.version: AndroidDriver
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:91)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:141)
at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:69)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:601)
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:241)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:128)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:141)
at io.appium.java_client.DefaultGenericMobileDriver.(DefaultGenericMobileDriver.java:38)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:83)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:93)
at io.appium.java_client.android.AndroidDriver.(AndroidDriver.java:72)
at pagamento.Boleto_bancario.testeLogin(Boleto_bancario.java:36)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)

-------------codigo-----

public class Boleto_bancario {

public static AndroidDriver driver;

@test
public void testeLogin() throws MalformedURLException {

	File diretorioAplicacao = new File("d:\\automacao");
	File arquivoAplicacao = new File(diretorioAplicacao, "Banestes.apk");
	
	DesiredCapabilities capacidade = new DesiredCapabilities();
	capacidade.setCapability(MobileCapabilityType.PLATFORM_NAME, MobilePlatform.ANDROID);
	capacidade.setCapability(MobileCapabilityType.DEVICE_NAME, "Android Emulator");
	capacidade.setCapability(MobileCapabilityType.APP, arquivoAplicacao.getAbsolutePath());
	// capacidade.setCapability("appPackage",
	// "br.com.martinlabs.apptite.android");

	driver = new AndroidDriver(new URL("http://127.0.0.1:4727/wd/hub/status"), capacidade);
    driver.manage().timeouts().implicitlyWait(80, TimeUnit.SECONDS);

}

@After
public void Fim() {
    if (driver != null) {
	driver.quit();
    }
 }

}

@KazuCocoa
Copy link
Member

@danubiapaiva
Your attached log seems Java client. Could you create an issue on java client repository?
https://github.com/appium/java-client


BTW, Appium server's default port is 4723. So, if you ran an Appium server without specific port number with -p 4727, your following code was wrong.

- driver = new AndroidDriver(new URL("http://127.0.0.1:4727/wd/hub/status"), capacidade);
+ driver = new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub/status"), capacidade);

https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/server-args.md

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

No branches or pull requests

4 participants