appium

Error : impossible to create a new session because 'createSession' which takes HttpClient, InputStream and long was not found

拥有回忆 提交于 2020-01-01 05:18:10
问题 I am trying to automate an android hybrid app but getting following errors: 1) Exception in thread "main" org.openqa.selenium.WebDriverException: It is impossible to create a new session because 'createSession' which takes HttpClient, InputStream and long was not found or it is not accessible 2) Caused by: java.lang.reflect.InvocationTargetException 3) Caused by: org.openqa.selenium.WebDriverException: No such context found. 4) NoSuchContextError: No such context found. Following is the code

Appium+python HTML测试报告(1)

我与影子孤独终老i 提交于 2020-01-01 03:35:37
测试任务执行完成后,我们需要一份通俗易懂的测试报告来展示自动化测试的结果。 HTMLTestRunner是Python的单元测试框架unittest的一个扩展,它生成易于使用的HTML测试报告。与TextTestRunner一样提供run()方法来执行测试套件或测试用例,返回特定的值表示执行结果。 一、HTMLTestRunner配置 1、HTMLTestRunner.py的下载 下载地址: python2: http://tungwaiyip.info/software/HTMLTestRunner.html 右键另存为下载HTMLTestRunner.py,将文件放到...\python\Lib目录下 python3: https://pan.baidu.com/s/1k4m6JFelcWH_QiHGlvjsUQ HTMLTestRunner是基于Python2开发的,要支持python3,需要修改HTMLTestRunner.py文件中的部分内容。上面下载链接为已修改文件,将文件放到...\python\Lib目录下。 在python交互模式下导入HTMLTestRunner模块,系统没有报错则说明添加成功。 >>> import HTMLTestRunner >>> 2、生成HTML测试报告 # coding:utf-8import unittest, timefrom

Variety of issues testing Android Webview using Appium

左心房为你撑大大i 提交于 2019-12-31 07:01:14
问题 I have a hybrid app that is primarily just a webview. Here is the code for the basic test: @BeforeClass public static void setupAppium() throws MalformedURLException { DesiredCapabilities capabilities = new DesiredCapabilities(); capabilities.setCapability("appium-version", "1.5.3"); capabilities.setCapability("platformName", "Android"); capabilities.setCapability("platformVersion", "6.0"); capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "AppiumTesterDevice"); capabilities

Chrome browser is not able to navigate to any site in appium

耗尽温柔 提交于 2019-12-31 06:56:31
问题 I just installed chrome.apk file in android emulator, and It seems to be installed successfully. But When I tried to execute the below script, Its open up the chrome browser in emulator device but not displayed google home page. And simple the driver is quit. Sample code: It seems to be launch the browser, but not navigate to google home page public static WebDriver driver; @BeforeSuite public static void initalizeBrowser() throws Exception { try { DesiredCapabilities desired =

Installing appium on macOS sierra 10.12.3 [closed]

谁说我不能喝 提交于 2019-12-31 05:36:25
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 2 years ago . I bought a new mac machine and need to install appium from scratch. I just went through few docs from google but each site had different instructions. Can you please guide me through how to install all required software to run appium on Mac machine? 回答1: Check whether java is installed or not(If you want to use

System.TypeLoadException : Method 'Dispose' in type 'OpenQA.Selenium.Appium.Service.AppiumCommandExecutor'

有些话、适合烂在心里 提交于 2019-12-31 01:26:53
问题 My project stopped working. I have the newest version of all nugets and appium server. Where is a problem? I receive error like this: Message: OneTimeSetUp: System.TypeLoadException : Method 'Dispose' in type 'OpenQA.Selenium.Appium.Service.AppiumCommandExecutor' from assembly 'appium-dotnet-driver, Version=3.0.0.2, Culture=neutral, PublicKeyToken=null' does not have an implementation.** protected AppiumDriver<AppiumWebElement> driver = null; private DesiredCapabilities dc = new

How to preserve Appium session between multiple testng class

青春壹個敷衍的年華 提交于 2019-12-30 07:40:26
问题 I am automating Android application using Appium, I have One Base Class with Setup and Tear down (In setup initialization appium session and in teardown destroying session ). This Base Class I inherited in all testng classes, now for each test class Appium new session generated. So My question is that How we maintain appium session through out the all class once it generate for any class. Thanks Sadik 回答1: I have implemented this approach using Singlton design pattern here is approach: public

Appium:cmd下执行appium,报错:error: uncaughtException: Cannot find module 'internal/util/types'

家住魔仙堡 提交于 2019-12-27 04:24:10
一、场景回溯: Windows系统,安装appium for windows,版本为1.4.16,node js版本为v10.16.0,cmd下执行命令:appium,报错: 二、产生原因: appium与node js版本不匹配 三、问题解决: 卸载node js,安装node js版本为6.9.4; 或者 升级appium版本为:1.15.1。 (待验证) 来源: CSDN 作者: Johnny . Zuo 链接: https://blog.csdn.net/u014722022/article/details/103710412

Appium 常见问题

吃可爱长大的小学妹 提交于 2019-12-26 21:23:36
pip install 超时 解决方法:pip --default-timeout=1000 install -U selenium 执行adb devices报错 * daemon not running. starting it now on port 5037 * 解决方案: 1)执行netstat -ano | findstr "5037",查看5037端口时候被占用 2)若被占用,执行taskkill -f -pid **** 杀掉占用的进程 3)若端口未占用,需要检查系统配置文件:将C:\WINDOWS\System32下的adb.exe、AdbWinApi.dll文件复制到C:\Windows\SysWOW64中。 执行aapt提示“aapt不是内部或外部命令,也不是可运行的程序” 解决方法:\sdk\build-tools\目录下的任意文件夹下的aapt.exe复制到\sdk\platform-tools中 执行yarn -v提示“yarn : 无法加载文件 ***,因为在此系统上禁止运行脚本” 原因:运行的脚本为未签名脚本或来自其他用户的签名脚本 解决方法: 1)搜索powershell,右键以管理员身份运行 2)执行:set-ExecutionPolicy RemoteSigned,将计算机上的 执行策略更改为 RemoteSigned 3)查看执行策略:get

Appium api函数 基于python

ε祈祈猫儿з 提交于 2019-12-26 18:06:27
查询函数 1. findElement(s)ByName 在 Android 中基本没用。Android UI 没有 Name 这个属性。有说可以使用 text 值获取。但我并没有成功 2. findElement(s)ByClassName 通过类名来获取元素,用法如下: item_list = dr.find_elements_by_class_name("android.widget.LinearLayout") item_list[2].click() 3. findElementById 通过 resource_id 来获取元素,每个 Activity 中都是唯一的,用法如下 t = dr.find_element_by_id("com.tencent.mm:id/f7") t.send_keys(wechatId) 4. findElement(s)ByAccessbiltiyId 在 Android 上 AccessbilityID 实际就是 contentDescription 。这个属性是为了方便视力受损人士使用手机所设置。开启 TTS 后系统会朗读相关控件的 contentDescription。 5. findElement(s)ByXPath 通过 XML Path 描述来寻找元素。我没有成功的获取到,可能是 XPath 写的有问题。 s = dr.find