Skip to content

Instantly share code, notes, and snippets.

Created May 16, 2023 08:48
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
*** Settings ***
Library Selenium2Library
Library String
*** Variables ***
${BROWSER} edge
*** Test Cases ***
Network scanning
[Documentation] Print network details of test execution machine
${ip}= Evaluate [l for l in ([ip for ip in socket.gethostbyname_ex(socket.gethostname())[2] if not ip.startswith("127.")][:1], [[(s.connect(('', 53)), s.getsockname()[0], s.close()) for s in [socket.socket(socket.AF_INET, socket.SOCK_DGRAM)]][0][1]]) if l][0][0] socket
Log To Console Private IP is: ${ip}
Open Browser ${BROWSER}
${ippublic}= Get Text //html/body/pre #get the IP address text
Log To Console Public networking details are: ${ippublic}
Close Browser
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment