Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
507 views
in Technique[技术] by (71.8m points)

javascript - 硒如何单击屏幕上50%的元素和不屏幕上50%的元素?(How does Selenium click on elements that are 50% on screen and 50% not on screen?)

There is a div-Element.

(有一个div元素。)

50% of its size are on the screen.

(屏幕大小的50%在屏幕上。)

The other 50% go over the screen height and are not visible.

(其余50%超出屏幕高度,因此不可见。)

There is no scrolling possible.

(没有滚动的可能。)

I tried to automate a test with Selenium and click on that div-element, but sometimes it works and sometimes it does not.

(我尝试使用Selenium自动化测试,然后单击该div元素,但有时它可以工作,有时却不能。)

Why does Selenium not just click on the "on-screen-area" of that div?

(为什么Selenium不仅仅单击该div的“屏幕区域”?)

And how is this functionality implemented?

(以及如何实现此功能?)

When I tell Selenium to click on a huge div-element, does it click on a random position on that div?

(当我告诉Selenium单击一个巨大的div元素时,它是否单击了该div上的随机位置?)

  ask by ndsvw translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...