如何在使用C#的Selenium中使用JavaScriptExecutor将style属性设置为div(How to set style property to div using JavaScriptExecutor in selenium using C#)
我正在尝试使用JavaScriptExecutor使用C#设置div元素的样式。 下面是我尝试过的代码,但没有任何反应
IJavaScriptExecutor js = (IJavaScriptExecutor)driver; IWebElement element = driver.FindElement(By.XPath("//div[contains(@class,'rmSlide')]")); js.ExecuteScript("arguments[0].setAttribute(arguments[1], arguments[2])", element, "style", "visibility: visible; height: 259px; width: 339px; display: block; overflow: hidden; left: -81px; top: 24px; z-index: 2; " );
我所要做的就是将
display: block
设置为display: none
以下是元素的Html
I am trying to set style of a div element using JavascriptExecutor using C#. below is the code i tried but nothing happens
IJavaScriptExecutor js = (IJavaScriptExecutor)driver; IWebElement element = driver.FindElement(By.XPath("//div[contains(@class,'rmSlide')]")); js.ExecuteScript("arguments[0].setAttribute(arguments[1], arguments[2])", element, "style", "visibility: visible; height: 259px; width: 339px; display: block; overflow: hidden; left: -81px; top: 24px; z-index: 2; " );
All I am trying to do is setting the
display: block
fromdisplay: none
Below is the Html of the element
原文:https://stackoverflow.com/questions/48578091
最满意答案
您正在寻找
while : do wget -O - -q "http://some.url/" > /dev/null done
这不会保存文件,也不会输出无用的信息,并在
/dev/null
反复转储内容编辑只消耗带宽,使用
ping -f
或ping -f -s 65507
you're looking for
while : do wget -O - -q "http://some.url/" > /dev/null done
this will not save the file, not output useless info, and dump the contents over and over again in
/dev/null
edit to just consume bandwidth, use
ping -f
orping -f -s 65507
相关问答
更多-
限制带宽速度(Limit Bandwidth Speeds)[2024-02-26]
看看http://www.codeproject.com/KB/IP/MyDownloader.aspx 他使用的是众所周知的技术,可以在Downloader.Extension \ SpeedLimit中找到 基本上,在读取更多数据流之前,会检查自上次迭代以来实际读取了多少数据。 如果该速率超过最大速率,那么读取命令暂停很短的时间,并重复检查。 大多数应用程序使用此技术 Take a look at http://www.codeproject.com/KB/IP/MyDownloader.aspx He ... -
iperf允许您执行UDP和TCP测试。 在UDP模式下运行iperf时,您可以说明带宽。 这实际上是客户端尝试向服务器泵送的每秒数据量。 某些数据可能安全到达,但某些数据可能会丢失(由于服务器和客户端之间的实际带宽)。 在TCP模式下运行iperf时,仅在您想要限制带宽时才说明带宽(并且您还必须考虑数据包大小,因为由于iperf行为,这限制了最小带宽限制。 )。 实际带宽由TCP窗口大小和连接延迟确定 。 有关TCP窗口和吞吐量的更多信息,请参见此处 。 iperf allows you to perfo ...
-
确定可用带宽(Determining available bandwidth)[2022-12-29]
不会超出明显下载已知大小和时间的文件需要多长时间。 这样做的缺点就是你需要浪费很多带宽才能做到这一点。 此外,如果您想要在吞吐量降至阈值以下时发出警报,则必须连续运行测试。 恕我直言,我会在一些地方表现不佳,因为如果它确实发生,你无法做任何事情。 抱歉。 Not beyond the obvious of downloading a file of a known size and timing how long it takes. the disadvantage of that is that you' ... -
没有.CDN和带宽是完全不同的概念。 CDN代表Content Delivery Network,它允许您从距离您的应用程序用户最近的服务器提供Blob存储内容。 有关CDN的更多信息,请访问: http : //en.wikipedia.org/wiki/Content_delivery_network 。 带宽是传输的数据量(通常以字节为单位)。 No. CDN and Bandwidth are entirely different concepts. CDN stands for Content D ...
-
消耗带宽(Consuming bandwidth)[2022-07-30]
您正在寻找 while : do wget -O - -q "http://some.url/" > /dev/null done 这不会保存文件,也不会输出无用的信息,并在/dev/null反复转储内容 编辑只消耗带宽,使用ping -f或ping -f -s 65507 you're looking for while : do wget -O - -q "http://some.url/" > /dev/null done this will not save the file, ... -
零,除非在套接字上启用TCP KEEPALIVE,在这种情况下它仍然基本上为零。 但是500-600Kb并不是“非常小的包”。 你的意思是500-600 字节? Zero, unless TCP KEEPALIVE is enabled on the socket, in which case it is still essentially zero. But 500-600Kb is not 'very small packets'. Do you mean 500-600 bytes?
-
延迟带宽(Bandwidth from Latency)[2022-04-24]
然而,存在称为分组对探测的技术。 您将一个接一个地发送到数据包。 从理论上讲,可用带宽越少,到达时间就越多。 There is however a technique called packet pair probing. You send to packets one immediately after the other. In theory, the less bandwidth available, the more they will spread away in arrival time. -
闪存带宽检测(flash bandwidth detection)[2021-09-26]
你可以将你的内容分解成碎片,关键和非关键。 加载第一个,计时,然后加载第二个,如果满足要求。 我之前做过一个有画外音的游戏。 你可以在没有它们的情况下玩游戏,所以如果我检测到实际游戏的负载较慢,我会提示用户。 然后他们可以选择等待声音,或继续玩。 You could break your content into pieces, the crucial, and the non-crucial. Load the first, time it, and then load the second if the ... -
在特定区域内,根本没有转移成本。 您提到过使用App Service,blob和SQL数据库。 只要这些服务位于单个区域内,当它们与该区域内的任何其他服务之间的数据流动时,带宽成本为零。 带宽专门用于出站转移。 所以,基本上你会计算出离开给定区域的所有数据。 Within a given region, there are no transfer costs at all. You mentioned using App Service, blobs, and SQL Database. As long a ...
-
首先,您的网卡可能是100Mb /秒而不是100MB /秒。 到目前为止,以太网是最常见的有线网络类型,通常每秒10,100,1000兆比特 。 100兆比特/秒的以太网接口大致能够达到每秒12.5兆比特的速度。 如果您已插入以太网交换机 ,则最有可能以全双工模式连接。 这允许两端在不影响彼此性能的情况下同时彼此对话。 你永远无法达到完全宣传的速度,千兆网络接口(1000Mb /秒)通常能够在高速900的每个方向上传输而没有问题。 有一些因素导致开销无法达到全速。 此外,许多低端网卡或计算机都难以达到全速, ...