仅当颜色改变时如何检测Webelement的状态 [英] How to detect the state of a Webelement if only it's colour changes

查看:109
本文介绍了仅当颜色改变时如何检测Webelement的状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题是这样的: 我有一个应用程序,我必须确定元素的状态.元素在位置编号1中可以有两个状态-在位置编号2中它具有黑色背景-在白色背景中具有白色状态.没有其他改变,它的大小,值,名称,可见性或启用的值都没有,仅是背景色.

My problem is this: I have an application and I have to decide the state of an element. The element can have two states, in position number 1 - it has black background in position number 2 - it has white background. Nothing else changes on it, nor it's size, nor it's value, nor it's name, nor it's visibility, nor it's enabled value nothing... Only it's background colour.

想象一下,如果您在屏幕上有一个按钮,然后点击它只会改变它的背景.

Imagine it like if you had a button on the screen and tapping on it changes only it's background.

您是否知道该怎么做才能了解此网络元素的状态?

Do you have any idea what could I do in order to get the state of this webelement?

推荐答案

如果我正确理解它,则需要使用背景色来标识该元素.您可以使用 SikuliX Java api

If I understand it correctly , you want to identify the element with its background color. You can do that with SikuliX Java api

最简单的方法是如何设置SikuliX"和此处是如何在Java(与Maven,因此拥有所有依赖项)中一起使用它

The easiest way is Option 2 under "How do I set up SikuliX" and here is how to use it with Java (with Maven, so you have all the dependencies)

此处是我与SikuliX共同完成的一个项目,以防万一帮助.

here is a project I did with SikuliX, in case it is of any help.

我不确定,如果您要尝试在移动设备中进行操作,但是我认为,如前提条件中所述,目前它不能与移动设备一起使用.

I am not sure , if you are trying to do it in mobile but I think right now it can not be used with mobile devices, as mentioned in pre-requisites.

这篇关于仅当颜色改变时如何检测Webelement的状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆