selenium positioning rect element

rect element attribute

The attributes of the rect element are as follows:

  • x: This property determines the x-coordinate of the rectangle.
    Value Type: | ; Default: 0 Animation: Yes
  • y: This property determines the y coordinate of the rectangle.
    Value Type: | ; Default: 0 Animation: Yes
  • width: This property determines the width of the rectangle.
    Value Type: Auto || ; Default: Auto; Animation: Yes
  • height: This property determines the height of the rectangle.
    Value Type: Auto || ; Default: Auto; Animation: Yes
  • rx: This property determines the horizontal corner radius of the rectangle.
    Value Type: Auto || ; Default: Auto; Animation: Yes
  • ry: This property determines the vertical corner radius of the rectangle.
    Value Type: Auto || ; Default: Auto; Animation: Yes
  • pathLength: This attribute allows specifying the total length of the path in user units.
    Value Type: ; Default: None; Animation: Yes
  • As of SVG2, x, y, width, height, rx and ry are geometric properties, which means that these properties can also be used as CSS properties for that element.

Rect element positioning method

//*[name()="rect"]

As shown in the figure, using the following expression, you can locate the element

//*[@id="hourHolder"]//*[name()="rect"][37]

insert image description here

However, using common expressions, the element cannot be located
insert image description here

The following is the test link
http://www.weather.com.cn/weather/101040100.shtml

Guess you like

Origin blog.csdn.net/zhuan_long/article/details/131861225