1

I am trying to use obj.FindElementById("GraphicsLayer_layer").Click to click the polygon in the web page. However this command can only click the center point of the layer instead of the polygon.

Is there any other method I can use to click the polygon correctly?

Here is the screenshot showing the polygon in the web page:

enter image description here

Here is the codes for "GraphicsLayer_layer":

<svg overflow="hidden" width="730" height="500" id="mMapView_gc" style="touch-action: none; will-change: transform; overflow: visible; position: absolute; transform: translate(-113px, 143px);">
    <g id="GraphicsLayer_layer" style="display: block;">
        <g>
            <path fill="rgb(0, 0, 255)" fill-opacity="0.2" stroke="rgb(0, 0, 255)" stroke-opacity="1" stroke-width="2" stroke-linecap="butt" stroke-linejoin="miter" stroke-miterlimit="4" path="M 524,256 527,241 531,226 536,208 535,187 533,168 527,151 517,135 509,123 498,113 487,107 472,96 450,85 435,79 422,76 410,75 395,74 380,78 365,84 356,90 345,100 330,112 318,122 303,136 291,147 286,154 281,162 275,170 264,163 272,152 281,142 293,128 307,109 322,91 332,80 342,68 350,60 360,53 372,44 381,40 390,38 398,37 407,38 418,40 431,43 448,46 462,49 474,55 491,66 506,81 513,86 523,99 531,113 537,126 542,142 547,157 549,171 550,185 550,198 548,215 545,226 538,237 524,256 Z" d="M 524 256 527 241 531 226 536 208 535 187 533 168 527 151 517 135 509 123 498 113 487 107 472 96 450 85 435 79 422 76 410 75 395 74 380 78 365 84 356 90 345 100 330 112 318 122 303 136 291 147 286 154 281 162 275 170 264 163 272 152 281 142 293 128 307 109 322 91 332 80 342 68 350 60 360 53 372 44 381 40 390 38 398 37 407 38 418 40 431 43 448 46 462 49 474 55 491 66 506 81 513 86 523 99 531 113 537 126 542 142 547 157 549 171 550 185 550 198 548 215 545 226 538 237 524 256Z" stroke-dasharray="none" dojoGfxStrokeStyle="solid" fill-rule="evenodd">
            </path>
        </g>
    </g>
    <g id="DangRoadSignLayer_layer" opacity="0" data-geometry-type="point" style="display: block;">
        <g>
        </g>
    </g>
    <defs>
    </defs>
    <g id="mMapView_graphics_layer" style="display: block;">
        <g>
        </g>
    </g>
</svg>
2
  • 1
    Welcome to Stack Overflow. Please note that because this is no free code writing service it is necessary that you show either what you have tried so far and where you got stuck or errors (by showing your code) or at least to show what you have researched and the effort you made. Otherwise it is just asking us to do all the work for you. Reading How to Ask might help you to improve your question. Commented Jul 16, 2021 at 6:50
  • Please add your code to the question. Using the code tags and not as an image please. Commented Jul 16, 2021 at 8:22

1 Answer 1

2

That's an svg element, you can locate it using the below xpath :-

//*[name()='svg' and @id='mMapView_gc']

or

//*[name()='svg' and @id='mMapView_gc']/*
Sign up to request clarification or add additional context in comments.

8 Comments

Thx for your help
The XPath works but the "click" command is selecting the center point of the map. Is there any "click" function that can click a specific colour in web page? drive.google.com/file/d/1B7AOiAAKrp8esBbRCqM0HEtyZowG7L7D/…
I see there are few rgb(0, 0, 255), which one you want to click ?
I want to click the infill colour <path fill="rgb(0, 0, 255)" fill-opacity="0.2"
Can you try this //*[name()='svg' and @id='mMapView_gc']/*/*/*
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.