iPhone automation - web testing

Every time I launch a script, instead of automating the login page, driver takes session from previous script. I am running the script on iPhone simulator. I am also resetting the device. Please refer the above code for more info,

> ServerArguments serverArguments = new ServerArguments();
> serverArguments.setArgument("--address", "127.0.0.1");
> serverArguments.setArgument("--no-reset", false);
> serverArguments.setArgument("--command-timeout", 2400);
> serverArguments.setArgument("--local-timezone", true);
> serverArguments.setArgument("--full-reset", true);
> this.appiumServer = new AppiumServer(new File("/usr/local/bin/node"), new File("/usr/local/lib/node_modules/appium/build/lib/main.js"),serverArguments);
>             this.appiumServer.startServer();

I am using Genium framework for starting/stopping appium server.

I am setting the above capabilities in DesiredCapabilities class,

> capabilities.setCapability("platformName", "iOS");
> capabilities.setCapability("udid", udid);
> capabilities.setCapability("browserName", "Safari");
> if (!platformVersion.equals("")) {
>     capabilities.setCapability("platformVersion", platformVersion);
> }
> capabilities.setCapability("deviceName", deviceName);
> capabilities.setCapability("autoWebview", true);
> capabilities.setCapability("newCommandTimeout", 120);

Are you starting a new session each test? Also, try adding the reset info to your caps instead…

    desiredCapabilities.setCapability("fullReset", true);
    desiredCapabilities.setCapability("noReset", false);

I tried with this. But it still starts using last session