我们可以使用 Selenium/Appium 在 webpage/Mobile 应用程序上验证文本对齐吗
Can we validate text alignment on a webpage/Mobile App using Selenium/Appium
假设一个移动应用或网络表单包含 2 个按钮 "OK" 和 "Cancel"。
根据要求,确定应该放在取消按钮的左侧。
例如:
确定取消
有没有一种方法可以使用 Selenium/Appium 来验证“取消”按钮是否出现在“确定”按钮的右侧。
目前,我正在通过截图手动验证这个场景。
我正在使用 C#。
如有任何建议或建议,我们将不胜感激。
IWebElement 上有一个 location 属性,returns 一个点值。
Gets a Point object containing the coordinates of the upper-left corner of this element relative to the upper-left corner of the page.
所以您可以比较这两个对象,看看一个元素的相对位置是在另一个元素的左侧还是右侧。
假设一个移动应用或网络表单包含 2 个按钮 "OK" 和 "Cancel"。 根据要求,确定应该放在取消按钮的左侧。 例如:
确定取消
有没有一种方法可以使用 Selenium/Appium 来验证“取消”按钮是否出现在“确定”按钮的右侧。
目前,我正在通过截图手动验证这个场景。
我正在使用 C#。
如有任何建议或建议,我们将不胜感激。
IWebElement 上有一个 location 属性,returns 一个点值。
Gets a Point object containing the coordinates of the upper-left corner of this element relative to the upper-left corner of the page.
所以您可以比较这两个对象,看看一个元素的相对位置是在另一个元素的左侧还是右侧。