GithubHelp home page GithubHelp logo

Comments (5)

mykola-mokhnach avatar mykola-mokhnach commented on July 29, 2024

Is Appium really listening on that port? What is the output of netstat -an | grep 21077 ? Have you tried to execute Appium on the default port?

from appium-ios-inspector.

darina-techery avatar darina-techery commented on July 29, 2024

Yes, Appium is really listening on this port, it's assigned randlomly for each test session.

13:49:28.645 [main] INFO  (AppiumServiceProvider.java:38): Starting Appium service on port 21077

I use a simple java helper method to update inspector.js with this port and launch it:

public static void launchIOSInspector() {
		String browserName = "Google Chrome";
		String inspectorHtmlLocation = "{my local path}/Appium-iOS-Inspector/iOS%20Inspector.html";
		String inspectorConfiguration = "{my local path}/Appium-iOS-Inspector/iOS Inspector_files/inspector.js";

		List<String> content = new ArrayList<>();
		Path configPath = new File(inspectorConfiguration).toPath();
		try (BufferedReader reader = Files.newBufferedReader(configPath)) {
			String line;
			while ((line = reader.readLine()) != null) {
				if (line.contains("APPIUM_ROOT")) {
					content.add(line.replaceAll("127\\.0\\.0\\.1:\\d+", "127.0.0.1:" + DriverProvider.getAppiumPort()));
				} else {
					content.add(line);
				}
			}
			reader.close();
		} catch (IOException x) {
			System.err.format("IOException: %s%n", x);
		}
		try (BufferedWriter writer = Files.newBufferedWriter(configPath)) {
			for (String line : content) {
				writer.write(line, 0, line.length());
				writer.newLine();
			}
			writer.close();
		} catch (IOException x) {
			System.err.format("IOException: %s%n", x);
		}
		String openInspectorCommand = "osascript -e 'tell application \""+browserName+"\"\n" +
				"  set myTab to make new tab at end of tabs of window 1\n" +
				"  set URL of myTab to \"file://"+inspectorHtmlLocation+"\"\n" +
				"  activate\n" +
				"end tell'";
		CMDUtils.executeCommand(openInspectorCommand);
	}

from appium-ios-inspector.

mykola-mokhnach avatar mykola-mokhnach commented on July 29, 2024

Maybe you try to open inspector too early when Appium session is still not ready? What do you see if you manually navigate to that url? Do you see the list of active sessions by adding /sessions suffix?

from appium-ios-inspector.

darina-techery avatar darina-techery commented on July 29, 2024

I've just launched it, and it worked... Nothing has changed in the environment and tests, only new Appium.app was installed.
I'm sorry, but I really cannot tell what happened :( I can only say it's not the first time I experience this issue: inspector stops working at some point and goes back to life in a few days.

from appium-ios-inspector.

mykola-mokhnach avatar mykola-mokhnach commented on July 29, 2024

There is no magic there - we either have a connection to running Appium server and can connect to it or the server is not available and thus the error like the one above is shown. Closing as inspector-unrelated issue.

from appium-ios-inspector.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.