开发者

How to check alignment of text using selenium RC

开发者 https://www.devze.com 2023-04-09 10:57 出处:网络
verify alignment of text or any other element in web page using selenium rc. i use python, is there any budy who can he开发者_如何转开发lp with this.you can utilize getAttribute command for example

verify alignment of text or any other element in web page using selenium rc. i use python, is there any budy who can he开发者_如何转开发lp with this.


you can utilize getAttribute command for example

String align = selenium.getAttribute("ele_locator@align");


In case text alignment is coded directly in HTML you could do what you want using the assertElementPresent() method and a suitable XPath locator. For example to check the following text

<p id="paragraph" align="right">Text text text text text text text</p>

you could use

selenium.isElementPresent("//p[@id='paragraph' and @align='right']");
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号