从随机网站访问标签或文本框值 [英] Accessing a label or textbox value from a random website

查看:85
本文介绍了从随机网站访问标签或文本框值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我想要做的是,从网站访问特定的标签或文本框,其ID可能已知或可能未知,以及将该值与另一个固定值进行比较。假设标签显示为OFF,我想继续将该值与off进行比较,直到它变为on并且比较器返回false。我尝试使用Coded UI Testing,但问题是我无法自动运行断言函数。假设我使用按钮创建一个Windows窗体项目,并在按钮单击时,我应该能够运行此测试功能。我尝试使用其dll从Coded UI项目类添加引用(在表单项目中),但它在构建时出错。请提前一些方法来解决这个问题。

Hi guys,

What i want to do is, access a particular label or text box from a website, whose ID may or may not be known, and compare that value with another fixed value. Suppose that label says "OFF" , I want to keep comparing that value with off, until it becomes on and the comparator returns false. I tried using Coded UI Testing, but the problem is I'm not able to run the asserted function automatically. Say I create a windows forms project with a button, and on button click, I should be able to run this Testing function. I tried adding reference (in forms project) from the Coded UI project class using its dll, but it gave errors on building. Please suggest some method to resolve this, thanks in advance.

推荐答案

如果我完全理解你,你需要一个后台工作来启动按钮点击然后再检查直到定义时间或直到您的按钮开启,您可以由后台工作人员
if i understand you perfectly you need a background work to start on when button clicked and then check untill defined time or until your button becomes on you can do this by background worker


这篇关于从随机网站访问标签或文本框值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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