<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Python Selenium Script for adding IPs to VPN Exclusion for new gui - Add button XPATH not workin in Network Platform API</title>
    <link>https://community.cisco.com/t5/network-platform-api/python-selenium-script-for-adding-ips-to-vpn-exclusion-for-new/m-p/5408040#M1555</link>
    <description>&lt;P&gt;I ended up finishing the python script for this in the new gui. Using some selenium, pyautogui, and openpyxl. I'll post the generic code on GitHub and link it here.&lt;/P&gt;</description>
    <pubDate>Wed, 20 Jul 2022 17:36:35 GMT</pubDate>
    <dc:creator>DKCisco</dc:creator>
    <dc:date>2022-07-20T17:36:35Z</dc:date>
    <item>
      <title>Python Selenium Script for adding IPs to VPN Exclusion for new gui - Add button XPATH not working</title>
      <link>https://community.cisco.com/t5/network-platform-api/python-selenium-script-for-adding-ips-to-vpn-exclusion-for-new/m-p/5408039#M1554</link>
      <description>&lt;P&gt;I'm attempting to modify this project&lt;BR /&gt;&lt;A href="https://github.com/oborys/Selenium_automation_Adding_Cisco_Meraki_VPN_exclusion_rules" target="_blank" rel="noopener nofollow noreferrer"&gt;https://github.com/oborys/Selenium_automation_Adding_Cisco_Meraki_VPN_exclusion_rules&lt;/A&gt; to the current dashboard setup. I'm running into some issues with the 'add' button on the 'Local internet breakout' box.&lt;/P&gt;&lt;P&gt;I've tried several methods for the locator with various errors.&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;for&lt;/SPAN&gt; &lt;SPAN&gt;ipPort&lt;/SPAN&gt; &lt;SPAN&gt;in&lt;/SPAN&gt; &lt;SPAN&gt;ipListAndPort&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&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gt;, &lt;/SPAN&gt;&lt;SPAN&gt;" Ports "&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;port&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;        &lt;/SPAN&gt;&lt;SPAN&gt;time&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;sleep&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;3&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;        &lt;/SPAN&gt;&lt;SPAN&gt;#button = driver.find_element(By.TAG_NAME, "//a[@class='btn btn-default']")&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;        &lt;/SPAN&gt;&lt;SPAN&gt;#button = driver.find_element(By.TAG_NAME, "fa fa-plus plus")&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;        &lt;/SPAN&gt;&lt;SPAN&gt;#button = driver.find_element(By.TAG_NAME, 'add')&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;        &lt;/SPAN&gt;&lt;SPAN&gt;#button = WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.ID, "btn btn-default")))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;        &lt;/SPAN&gt;&lt;SPAN&gt;#button = WebDriverWait(driver, 10).until(By.CSS_SELECTOR, "a[class='btn btn-default']")&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;        &lt;/SPAN&gt;&lt;SPAN&gt;button = WebDriverWait(driver, 10).until(By.XPATH, "//a[@class='btn btn-default']")&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;        &lt;/SPAN&gt;&lt;SPAN&gt;time&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;sleep&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;        &lt;/SPAN&gt;&lt;SPAN&gt;button&lt;/SPAN&gt;&lt;SPAN&gt;.click()&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;Using selectors hub I've confirmed the XPATH is //a[@class='btn btn-default'] but when I debug I get the error&lt;BR /&gt;'str' object is not callable&lt;/P&gt;&lt;P&gt;I haven't been able to locate the actual ID to try that. Inspecting the element I see that the below section contains the "Add"&lt;BR /&gt;&amp;lt;a class="btn btn-default" data-toggle="dropdown" data-domplate="href" href="#rule_menu_vpn_exclusion_shaper"&amp;gt;&lt;BR /&gt;Add&lt;BR /&gt;&amp;lt;i class="fa fa-plus plus"&amp;gt;&amp;lt;/i&amp;gt;&lt;BR /&gt;&amp;lt;/a&amp;gt;&lt;/P&gt;&lt;P&gt;If I try by tag name I get the error&lt;BR /&gt;&lt;SPAN&gt;Message: no such element: Unable to locate element: {"method":"tag name","selector":"//a[@class='btn btn-default']"}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Message: no such element: Unable to locate element: {"method":"tag name","selector":"fa fa-plus plus"}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Message: no such element: Unable to locate element: {"method":"tag name","selector":"add"}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If there is a better method for this I'm open to it but I didn't have much luck using autogui and I'd like this to be able to work from multiple pcs so using selenium would be preferred.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jul 2022 17:02:41 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/python-selenium-script-for-adding-ips-to-vpn-exclusion-for-new/m-p/5408039#M1554</guid>
      <dc:creator>DKCisco</dc:creator>
      <dc:date>2022-07-13T17:02:41Z</dc:date>
    </item>
    <item>
      <title>Re: Python Selenium Script for adding IPs to VPN Exclusion for new gui - Add button XPATH not workin</title>
      <link>https://community.cisco.com/t5/network-platform-api/python-selenium-script-for-adding-ips-to-vpn-exclusion-for-new/m-p/5408040#M1555</link>
      <description>&lt;P&gt;I ended up finishing the python script for this in the new gui. Using some selenium, pyautogui, and openpyxl. I'll post the generic code on GitHub and link it here.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jul 2022 17:36:35 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/python-selenium-script-for-adding-ips-to-vpn-exclusion-for-new/m-p/5408040#M1555</guid>
      <dc:creator>DKCisco</dc:creator>
      <dc:date>2022-07-20T17:36:35Z</dc:date>
    </item>
    <item>
      <title>Re: Python Selenium Script for adding IPs to VPN Exclusion for new gui - Add button XPATH not workin</title>
      <link>https://community.cisco.com/t5/network-platform-api/python-selenium-script-for-adding-ips-to-vpn-exclusion-for-new/m-p/5408041#M1556</link>
      <description>&lt;P&gt;&lt;A href="https://github.com/DKCisco/-Python_Cisco_Meraki_VPN_Exclusion/blob/main/generic-fillLocalInternetBreakout.py" target="_blank" rel="nofollow noopener noreferrer"&gt;https://github.com/DKCisco/-Python_Cisco_Meraki_VPN_Exclusion/blob/main/generic-fillLocalInternetBreakout.py&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jul 2022 21:13:01 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/python-selenium-script-for-adding-ips-to-vpn-exclusion-for-new/m-p/5408041#M1556</guid>
      <dc:creator>DKCisco</dc:creator>
      <dc:date>2022-07-26T21:13:01Z</dc:date>
    </item>
  </channel>
</rss>

