PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Saturday, July 30, 2022

[FIXED] How to cross check multiple IP's using robot framework

 July 30, 2022     ip-address, python, robotframework, selenium, validation     No comments   

Issue

How to cross check multiple IP's using robot framework:

Ex:

 ${Debug IP}=        192.168.101.103
 ${Gateway IP}=     191.168.104.102
 ${Subnet mask IP}=  132.145.128.101
 ${NEW IP}=          192.168.101.24

Here I created 4 variables as a input IP address and all are unique

If I Entered same IP address , need to show error

I wrote this command:

Should Not Match Regexp  | ${Debug IP} | ${Gateway IP} |  ${Subnet mask IP} | ${NEW IP}

But, it's apply for first 2 variables . it wont cross check with 3rd and 4th variable

Is there any othere way to validate

Thank you!


Solution

Using keyword List Should Not Contain Duplicates will help you out.

*** Settings ***

Library    Collections

*** Variables ***

${Debug IP} =          192.168.101.103
${Gateway IP} =        191.168.104.102
${Subnet mask IP} =    132.145.128.101
${New IP} =            192.168.101.24

*** Test Cases ***

IP addresses should be unique
    ${All IPs} =    Create List    ${Debug IP}    ${Gateway IP}    ${Subnet mask IP}    ${New IP}
    List Should Not Contain Duplicates    ${All IPs}


Answered By - Bouke
Answer Checked By - Terry (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing