小编Hel*_*nds的帖子

如何从linux中完全删除jenkins

我已经从不同的文件夹中删除了jenkins所有目录.但是当我访问URL时,它仍然向我显示jenkins登录.

我想完全卸载jenkins.已尝试过来自互联网的许多命令,但jenkins仍在服务器上.

我只通过putty访问命令行,所以我尝试通过命令删除jenkins.

linux jenkins

41
推荐指数
3
解决办法
8万
查看次数

如何比较2个iframe并在视觉上获得差异?

案件 :

我有 2 个 iframe,并且都有很多 div 和其他控件,因此两个 iframe 都像中等大小的 HTML 网站。我想比较两者并找出差异。

我认为这里有不同的选择:

解决方案1:对2个iframe进行完整截图,并使用Python的枕头库将两个屏幕截图进行比较,该库在屏幕截图的不匹配区域上绘制网格。但这里的问题是我没有在互联网上找到任何可以截取完整 iframe 屏幕截图的代码(我有一个带有滚动条的长 iframe)。我尝试了几乎所有关于 SO 的答案,但都适用于普通页面,但不适用于 iframe。

参考https : //blog.rinatussenov.com/automating-manual-visual-regression-tests-with-python-and-selenium-be66be950196

解决方案 2:以某种方式从两个 iframe 中获取所有 HTML 代码并进行比较,但这并不容易分析结果,因为它会发现一些不同的 HTML 代码或在 2 个 iframe 中不匹配。这将更像是文本比较,而不是我认为的一个好的解决方案。

所以我正在寻找可以使用Python 或 Javascript截取 iframe 完整屏幕截图的代码,或者一些更好的选项,它允许我比较 2 个 iframe 并找出差异。

我尝试了谷歌找到的几乎所有答案,如下所示:

在此处输入图片说明

示例 iframe 在这里给出,其中整个 html 都在 iframe 中:https : //grapesjs.com/demo.html,如果某些代码可以获取此 iframe 的完整屏幕截图,那么对我来说很容易进行比较。

html javascript python iframe selenium-webdriver

21
推荐指数
2
解决办法
814
查看次数

如何将元素从外部移动/拖动到 iframe

我需要将元素从 iframe 外部移动到 iframe 中。我的元素面板不是 iframe 的一部分,但我的画布在 iframe 中并且想要将元素移入其中。

我试过下面的代码:

 element_source = self._selenium.find_element(By.XPATH,
                                          '//div[@class="gjs-block-label"][contains(.,"Tooltip")]')
    element_target=self._selenium.find_element(By.CLASS_NAME,'gjs-frame')
    actions = ActionChains(self._driver)
    actions.drag_and_drop(element_source, element_target).perform()
    time.sleep(5)
Run Code Online (Sandbox Code Playgroud)

看起来问题是我必须在移动元素之前切换到 iframe,但在这里我看不到这种可能性,因为 drag_and_drop 是组合方法,其中我的 element_source在 iframe 之外,element_target是 iframe 本身。

所以如果我在拖放之前切换,它甚至找不到element_source

这是我正在处理的演示页面:https : //grapesjs.com/demo.html

在上面的演示中,左侧是 iframe,右侧面板是元素的集合。

javascript iframe jquery python-2.7 selenium-webdriver

21
推荐指数
1
解决办法
1205
查看次数

在自动化方面做了很多努力后,无法找到Android本机应用程序的验证

我正在进行Android原生应用程序的自动化,并希望通过文本验证登录验证.当我尝试使用Appium检查器和Uiautomator选择它时.两者都无法找到验证部分,因此很难选择它.

在此输入图像描述

我尝试了来自不同论坛和Appium讨论的代码,但仍然无法通过自动化找到验证.我尝试过以下方法:

代码1

JavascriptExecutor js = (JavascriptExecutor)driver;

WebElement field = driver.findElement(By.xpath("//android.widget.EditText[@text='Enter mobile number']"));
// Boolean is_valid = (Boolean)js.executeScript("return arguments[0].checkValidity();", field);

try {
    String message = (String) js.executeScript("return arguments[0].validationMessage;", field);
} catch (Exception E) {
Run Code Online (Sandbox Code Playgroud)

输出:

例外:org.openqa.selenium.WebDriverException:方法尚未实现

代码2

public boolean IsValidationFired() {
    if(driver.getPageSource().contains("Invalid")) {
        System.out.println("PASS");
    } else {
        System.out.println("FAIL");
    }
}
Run Code Online (Sandbox Code Playgroud)

输出:

打印=失败

我不确定它是javascript弹出窗口还是本机应用程序弹出窗口或Toast message.But要检查它并通过自动化验证.

更新

用于启动验证的代码是: contactnu.setError("Invalid phone number.");

java validation android selenium-webdriver appium

17
推荐指数
1
解决办法
638
查看次数

使用Jenkins从机器B运行机器A的构建

我有2台电脑.Com-A,Com-B.

我在Com-A上使用selenium webdriver,Testng和maven构建了自动化功能脚本.

Com-A已经安装了Jenkins,但是Com-B只有jenkins,我可以运行Com-B部署在Com-A中的构建吗?或者我还要为Com-B安装所有必要的软件吗?

testng maven jenkins selenium-webdriver

10
推荐指数
1
解决办法
1883
查看次数

使用Xcode构建命令或appium进行构建时测试失败

我在用 :

Xcode 10.1
Os Version : 12.1
iPhone 6
Run Code Online (Sandbox Code Playgroud)

我确实按照所有必需的步骤来设置构建和一切,但在尝试使用xcode构建构建项目时仍然出现错误.

我在签署问题或者我缺少一些配置之类的2件事之间感到困惑.在webdriver代理xproj中.

xcode构建命令的实际错误

Testing failed:
WebDriverAgentRunner-Runner.app encountered an error (Failed to install or launch the test runner. (Underlying error: Unable to launch com.apple.test.WebDriverAgentRunner-Runner. (Underlying error: The operation couldn’t be completed. (DTXMessage error 1.))))
Run Code Online (Sandbox Code Playgroud)

appium的实际错误

Error: Unable to launch WebDriverAgent because of xcodebuild failure: “xcodebuild failed with code 65”. Make sure you follow the tutorial at https://github.com/appium/appium-xcuitest-driver/blob/master/docs/real-device-config.md. Try to remove the WebDriverAgentRunner application from the device if it is installed and …
Run Code Online (Sandbox Code Playgroud)

appium appium-ios

7
推荐指数
1
解决办法
2420
查看次数

Genymotion模拟器与硒

我可以将genymotion模拟器与selenium集成吗?做Android应用的测试.使用selenium而不使用设备的功能我的意思是使用genymotion模拟器.

selenium selenium-webdriver genymotion

6
推荐指数
1
解决办法
1453
查看次数

jmeter延迟与实际浏览器负载测试

这是一个有效的测试,用于检查使用500个并发用户加载测试的Web的时间.

我用500线程用户运行jmeter,加速周期= 50,永远循环计数.使用"结果表"的监听器,也记录延迟.

当jmeter正在运行时,我尝试使用实际的浏览器(在我的情况下是IE8)加载/浏览测试中的Web,并在7秒内加载.但基于延迟,大部分结果是50k ++.

是实际浏览器中的7秒加载时间是否考虑"响应时间结果"?因为它是在实际浏览器中加载的.

另一个问题:延迟50k是否转换为秒?意味着50secs.如果我们基于jmeter结果加载被测网络?亲切地向我澄清这个:)

browser performance load jmeter performance-testing

6
推荐指数
1
解决办法
5343
查看次数

org.openqa.selenium.WebDriverException:未知错误:Chrome 无法启动:在 Ubuntu 18.04 上的 Jenkins 中使用 ChromeDriver Selenium 崩溃

Chrome 在我的 Jenkins 上不稳定。当我运行 build 5 次时,它运行 1 - 2 次成功,另外 3 次出现上述错误。

错误截图: 在此处输入图片说明

Chrome 代码:

ChromeOptions options = new ChromeOptions();
System.setProperty("webdriver.chrome.driver","/usr/local/bin/chromedriver");
options.addArguments("--headless");
options.addArguments("--no-sandbox");
options.addArguments("--disable-dev-shm-usage");
driver = new ChromeDriver(options);
driver.get("https://mywebsite.com");
     
Run Code Online (Sandbox Code Playgroud)

我已经采取了一些步骤:

  1. 为 google chrome 和 chrome 驱动程序提供了 777 权限

  2. 设置:在构建之前启动 Xvfb,然后在 Jenkins 构建设置中将其关闭为 True 在此处输入图片说明

  3. ChromeDriver 81.0.4044.69

  4. 谷歌浏览器 81.0.4044.129

  5. Ubuntu 18.04.4 LTS (GNU/Linux 4.15.0-99-generic x86_64)

java google-chrome jenkins selenium-webdriver ubuntu-18.04

6
推荐指数
1
解决办法
1076
查看次数

尝试使用java发送邮件时获取javax.mail.NoSuchProviderException

我已经阅读并尝试了stackoverflow和其他各种站点中给出的所有解决方案,但仍然遇到问题并获得异常.

代码:

import java.util.Properties;

import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.AddressException;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;

public class sendmail {

Properties emailProperties;
Session mailSession;
MimeMessage emailMessage;

public static void main(String args[]) throws AddressException,
        MessagingException {

    sendmail javaEmail = new sendmail();

    javaEmail.setMailServerProperties();
    javaEmail.createEmailMessage();
    javaEmail.sendEmail();
}

public void setMailServerProperties() {

    String emailPort = "587";//gmail's smtp port

    emailProperties = System.getProperties();
    emailProperties.put("mail.smtp.port", emailPort);
    emailProperties.put("mail.smtp.auth", "true");
    emailProperties.put("mail.smtp.starttls.enable", "true");

}

public void createEmailMessage() throws AddressException,
        MessagingException {
    String[] toEmails = { "emailid@gmail.com" };
    String …
Run Code Online (Sandbox Code Playgroud)

java email exception

5
推荐指数
1
解决办法
3564
查看次数