got this error : An unknown server-side error occurred while processing the command. Original error: Cannot read property 'replace' of undefined - appium-ios

Entered the desired capabilities from appium desktop and started the seesion and got this error : "An unknown server-side error occurred while processing the command. Original error: Cannot read property 'replace' of undefined"

On SetUp should be ("platformName", "iOS")
public void StartDriver()
{
DesiredCapabilities cap = new DesiredCapabilities();
cap.SetCapability("platformName", "iOS");
cap.SetCapability("deviceName", "iPhone Xr");
cap.SetCapability("automationName", "XCUITest");
cap.SetCapability("app","YourApp.app");
cap.SetCapability("autoAcceptAlerts", true);
driver = new IOSDriver<IWebElement>(new Uri("http://127.0.0.1:4723/wd/hub"), cap, TimeSpan.FromSeconds(300));
Assert.IsNotNull(driver.Context);
}

It would be better if you could provide more information about your error, but guessing from the error text, this is caused when you do not provide platformName capability.

Related

The following error occurred: An unknown server-side error occurred while processing the command, on Browsestack

Script failing on Browserstack (intermittently).
Using serenity-bdd , and executing on browserstack....
DesiredCapabilities capabilities = new DesiredCapabilities();
if (MyDriverClass.deviceType.equalsIgnoreCase("Tablet")) {
capabilities.setCapability("os_version", "8.0");
capabilities.setCapability("device", "Samsung Galaxy Tab S3");
capabilities.setCapability("real_mobile", "true");
capabilities.setCapability("browserstack.platform",
"ANDROID");
capabilities.setCapability("project", "Tablet_PROJECT");
capabilities.setCapability("browserstack.browser", "chrome");
capabilities.setCapability("browserstack.browser_version", "76.0");
//also used appium version 1.6.5
capabilities.setCapability("browserstack.appium_version", "1.7.1");
capabilities.setCapability("deviceOrientation", orientation);
capabilities.setCapability("browserstack.local", browserstackLocal);
capabilities.setCapability("browserstack.localIdentifier",
browserstackLocalIdentifier);
capabilities.setCapability("browserstack.debug", true);
capabilities.setCapability("browserstack.video", true);
capabilities.setCapability("build", browserStackTCBuild);
return new RemoteWebDriver(
new URL("https://" + username + ":" + accessKey + "#hub-
cloud.browserstack.com/wd/hub"),`enter code here`
capabilities);
I am not sure why getting server side error. Even all the script relate elements and locator is on the page and in view.
The error unknown server-side error is generally encountered when the element you are trying to locate is hidden/ not visible.
You will need to ensure that the element you are trying to locate is in the viewport and nothing is overlaying it. You can read more on the exact causes for the above error here.

Create Custom Json Error in Asp.NET MVC

I am using a JavaScript plug-in and if there is an error it expects format like;
{error: 'You are not allowed to upload such a file.'}
In my MVC Web API I am throwing error like;
var error = string.Format("An error has been occured. Please try again later.");
throw new HttpResponseException(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, error));
and it is represented in HTTP response like below;
{"Message":"An error has been occured. Please try again later."}
how can I achieve to return in first way?
You can create an anonymous object
throw new HttpResponseException(Request.CreateResponse(HttpStatusCode.InternalServerError,new { error = "your error message here!"}));

com.thoughtworks.selenium.SeleniumException: ERROR: Command execution failure

com.thoughtworks.selenium.SeleniumException: ERROR: Command execution failure. Please search the user group at https://groups.google.com/forum/#!forum/selenium-users for error details from the log window. The error message is: Object doesn't support property or method 'createEvent'
I am getting the above error, somebody please help me out on this issue.
Help will be appreciated.
SeleniumServer server = new SeleniumServer(rcc);
DefaultSelenium selenium = new DefaultSelenium("localhost", 1212, "*iexploreproxy", "http://");
server.start();
selenium.start();
selenium.windowMaximize();
selenium.open("URL");
selenium.waitForPageToLoad("25000");
selenium.windowMaximize();
selenium.type("id=lgnLogin_UserName", "dy4cl");
selenium.type("id=lgnLogin_Password", "Test1234");
selenium.click("lgnLogin_LoginButton");
selenium.waitForPageToLoad("10000");
String msg = selenium.getText("//table[#id='lgnLogin']/tbody/tr/td/table/tbody/tr[4]/td");
System.out.println(msg);
Upgrade your Selenium Server file to 2.32.0. you can download it from here
Let me know if you are still facing the same issue.

Unhandled exception at 0x ... in w3wp.exe: 0x ... : A heap has been corrupted

I'm building a project in Visual Studio 2012. When I press F5 to run the app, it works just fine, however when I load it up in IIS7 on my Windows Pro box, the first time I make a call to a specific code base, I get the following error.
The thread 'Win32 Thread' (0x4d8) has exited with code 0 (0x0).
Unhandled exception at 0x7797e6c3 in w3wp.exe: 0xC0000374: A heap has been corrupted.
First-chance exception at 0x778e32a0 in w3wp.exe: 0xC0000005: Access violation reading location 0x2039a9f2.
Unhandled exception at 0x778e32a0 in w3wp.exe: 0xC0000005: Access violation reading location 0x2039a9f2.
Now I've attached the w3wp.exe to the VS2012 debugger, but to be honest, I'm not sure how to debug this type of crash.
For reference, the code base that's being called in a WebAPI controller that makes a call to the ActiveHome SDK to control some automation bits.
// GET api/<controller>/5
public StatusModel Post(CommandModel command)
{
var activeHome = new ActiveHomeClass();
// execute command
var info = activeHome.SendAction(command.SendAction, String.Format("{0} {1}", command.Device, command.Command));
// return results
var status = new StatusModel { Device = command.Device, Status = info };
activeHome = null;
return status;
}
Note: I am compiling everything to use x86

Error codes for CryptographicExceptions?

I'm trying to map different CryptographicExceptions to custom exceptions and messages. For example, "Object already exists" ==> "Not enough permissions to access an existing RSA key container". However, when I examine CryptographicException class, I don't find any error code collection like other exception types have. I'm running on 3.5, so HResult is not available either. Finally, I cannot rely on the message, since it can be localized. Any other ideas?
public Exception GetMappedCryptographicException(CryptographicException e)
{
uint hresult = (uint)Marshal.GetHRForException(e);
switch (hresult)
{
case 0x8009000F; // OBJECT_ALREADY_EXISTS
return new Exception(e, "Not enough permissions to access RSA key container.");
default:
return new Exception(e, "Unexpected cryptographic exception occurred.");
}
}

Resources