Selenium Java, execute JS change page

Source: Internet
Author: User

1. Problems with certain selection buttons not being selected due to limitations on some pages of the page

a lot of times due to some restrictions on the page can cause us to not be able to use webdriver to achieve our manual normal operation, we can execute js to properly change the page style, For example, some selection boxes in the page display boundaries, because the reason for the display of the scroll bar while at the border when the click on the selection box is not a point can only drag the scroll bar adjustment position, but weddriver automation is not as smart as manual, This is what we can consider by JS to remove the scroll bar, to show all the information so that the above problems can be avoided. The application of JS is as follows: first you need to write a character-type js, and then use the Javascriptexecutor interface such as:

((Javascriptexecutor) driver). Executescript (JS)

Selenium Java, execute JS change page

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.