Forum Discussion

evertonalmeida's avatar
evertonalmeida
Occasional Contributor
7 years ago

Error mscorlib.dll on integration with Appium to Test Android aplications

 

Hello, I'm trying to test mobile Android applications, so I'm doing a integration of Test Complete with Appium.

But I'm receiving the folling error:
mscorlib.dll

I'm using this tutorial: https://unmesh.me/2013/08/25/testing-native-mobile-apps-with-testcomplete-and-appium-an-alternative/


This is my source code:

 

procedure TstAndroid();
var
Capabilities,
CapabilityType,
By,
uri,
driver,
CalculateButton,
WeightField,
HeightField;
begin
Capabilities := dotNET.OpenQA_Selenium_Remote.DesiredCapabilities.zctor();
CapabilityType := dotNET.OpenQA_Selenium_Remote.CapabilityType;
By := dotNET.OpenQA_Selenium.By;
//Capabilities.setCapability(CapabilityType.BrowserName, 'Chrome');
Capabilities.setCapability(CapabilityType.Version, '19');
Capabilities.setCapability(CapabilityType.Platform, 'Android');

//Set up the RemoteWebDriver
uri := dotNET.System.Uri.zctor('http://localhost:4723/wd/hub');

driver := dotNET.OpenQA_Selenium_Remote.RemoteWebDriver.zctor_3(uri,Capabilities);

//Get the Hight text field and enter value
HeightField := driver.FindElement(By.Name('Height'));
HeightField.SendKeys('181');

//Get the Weight text field and enter value
WeightField := driver.FindElement(By.Name('Weight'));
WeightField.SendKeys('80');

//Get the Calculate button and tap/click on it
CalculateButton := driver.FindElement(By.Name('Calculate'));

CalculateButton.Click();
end;

 

 

The error is occurring in this line:

 

driver := dotNET.OpenQA_Selenium_Remote.RemoteWebDriver.zctor_3(uri,Capabilities);

 

 

1 Reply

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi,

     

    The referenced article is quite outdated and my guess is that the version of Remote Web Driver that you are trying to use differs from the one mentioned in the article. This means that you should check constructors provided by the version of Web Driver you are using (using TestComplete's Code Completion window, for example) and use the one that accepts uri and capabilities as its parameters. In your version of Web Driver this may be not zctor_3 as in article, but, say zctor_2 and you might have to correct test code accordingly.

    Also, you may try to install exactly the same version of Web Driver that is mentioned in the article and check if test code works.

     

    P.S. "I'm trying to test mobile Android applications [...]" If you are just trying, I would recommend to create a test in TestComplete and check how well it works for you. The only reason of integration that I see is if you already have a bunch of existing Appium/Selenium tests that work well and you don't want to port them to TestComplete.