Зарегистрируйтесь сейчас для лучшей персонализированной цитаты!

Новости по теме

Is Selenium the Right Tool for Automating Your Network Settings?

9 ноября 2021 г Hi-network.com

Find the code sample for this project on DevNet Code Exchange

Selenium is an open-source tool that automates web browsers. It provides a single interface that lets testers automate user actions using multiple programming languages such as Ruby, Java, NodeJS, PHP, Perl, Python, and C#. But what if we try to automate some tasks that we can do only by using Web GUI interfaces/Dashboard? Let's check it out.

Some of the described examples were born from customers' requests when we found out that related features in the chosen license type are unavailable. We identified issues that we can't solve using API or CLI. For example, if we have a particular graphical web interface and related items that users can configure, we can automate this process by using a tool like Selenium that automates web browsers.

In the sample, you can see how we automatically add (from the list) VPN exclusion rules after running the script.

Using the methods below, the Web browser can find the first element on an HTML page with related parameters. Elements were chosen from different Cisco Web interfaces.

Find one element with examples.

Method with parameter

This can find the element

find_element_by_id("__dnaPlatformHeaderLeft") <div id="__dnaPlatformHeaderLeft"></div>
find_element_by_name("leaf_name") <input name="leaf_name" type="text" />
find_element_by_xpath("//input[@placeholder='192.168.0.0/24

tag-icon Горячие метки: Открытый исходный код Cisco DevNet network automation

Copyright © 2014-2024 Hi-Network.com | HAILIAN TECHNOLOGY CO., LIMITED | All Rights Reserved.
Our company's operations and information are independent of the manufacturers' positions, nor a part of any listed trademarks company.