API Automation Testing : Is there any way to automate download scenario with content validation?

2 options. If you are sure the binary contents of the file will never change, do a binary comparison, see this example: upload-image.feature: And match response == read(‘karate-logo.jpg’) You have to write some custom code. There are Java libraries to read Excel. Use one of those, read the data, and then compare with expected results. … Read more

PsExec Throws Error Messages, but works without any problems

This is because PowerShell sometimes reports a NativeCommandError when a process writes to STDERR. PsExec writes the infoline PsExec v1.98 – Execute processes remotely Copyright (C) 2001-2010 Mark Russinovich Sysinternals – www.sysinternals.com to STDERR which means it can cause this. For more information, see these questions / answers: https://stackoverflow.com/a/1416933/478656 https://stackoverflow.com/a/11826589/478656 https://stackoverflow.com/a/10666208/478656

Using conditional statements inside ‘expect’

Have to recomment the Exploring Expect book for all expect programmers — invaluable. I’ve rewritten your code: (untested) proc login {user pass} { expect “login:” send “$user\r” expect “password:” send “$pass\r” } set username spongebob set passwords {squarepants rhombuspants} set index 0 spawn telnet 192.168.40.100 login $username [lindex $passwords $index] expect { “login incorrect” { … Read more

Selenium can’t open a second page

options.add_experimental_option( “excludeSwitches”, [‘enable-automation’]) options.add_argument( “user-agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36”) options.add_argument(“–remote-debugging-port=9222”) driver = webdriver.Chrome(options=options) driver.get( “https://www.justdial.com/Chennai/Hr-Consultancy-Services/nct-10258625/page-2”) driver.set_page_load_timeout(30) driver.get( “https://www.justdial.com/Chennai/Hr-Consultancy-Services/nct-10258625/page-3”) the website is detecting automation use above code 🙂 You can also do this in single line Just add below argument: options.add_argument(‘–disable-blink-features=AutomationControlled’) disabling enable-automation , or disabling automation controller disables … Read more

python-pptx – How to replace keyword across multiple runs?

As one can find in python-pptx’s documentation at https://python-pptx.readthedocs.io/en/latest/api/text.html a text frame is made up of paragraphs and a paragraph is made up of runs and specifies a font configuration that is used as the default for it’s runs. runs specify part of the paragraph’s text with a certain font configuration – possibly different from … Read more

Karate- Need help to assert a single dimension array for date range

Here you go: * def dateToLong = “”” function(s) { var SimpleDateFormat = Java.type(‘java.text.SimpleDateFormat’); var sdf = new SimpleDateFormat(“yyyy-MM-dd’T’HH:mm:ss.SSS”); return sdf.parse(s).time; } “”” * def min = dateToLong(‘2019-04-24T17:25:00.000’) * def max = dateToLong(‘2019-04-24T17:50:00.000’) * def isValid = function(x){ var temp = dateToLong(x); return temp >= min && temp <= max } * def response = … Read more