Forum Discussion

BijuBalan's avatar
BijuBalan
New Contributor
2 years ago
Solved

Service virtualization : Is it possible to use regular expression in resource path

We are using Ready API for service virtualization, is it possible to use regular expression in resource path,

Ex : Get /services/data/v11.0/query

Incoming request to the service will be http://{host}:{port}/services/data/v11.0/query?q=query parameter

In the above v11.0 is dynamic and for few environments we get v10.0, so we would like to know is there any way to use regular expression in resource path?

We tried using /services/data but this did not work.

2 Replies

  • hey, i took your code and then ran it, it seems to work on my end when i run the testexcel() function.

     

    from os import sys
    sys.path.insert(0, 'C:\\Users\\justin.kim\\AppData\\Local\\Programs\\Python\\Python36\\Lib\\site-packages')
    import openpyxl
    
    def ExcelReadSingleCell(Sheet,Cell):
      excelPath = "C:\\Users\\justin.kim\\Desktop\\test.xlsx"
      wb = openpyxl.load_workbook(excelPath )
      ws = wb.get_sheet_by_name(Sheet)
      mycell=ws[Cell]
      return str(mycell.value)
    
      
      
      
    def testExcel():
      Log.Message(ExcelReadSingleCell("Sheet1", "D3"))
      Log.Message(ExcelReadSingleCell("Sheet1", "D4"))
      Log.Message(ExcelReadSingleCell("Sheet1", "D5"))
      Log.Message(ExcelReadSingleCell("Sheet1", "C3"))
      Log.Message(ExcelReadSingleCell("Sheet1", "C5"))

     

      

    I'd suggest filing for a support ticket, and the support engineers will guide you through using probably the report generator utility to take a look at your system and see if they can identify what the problem is with TestComplete when you are running your system. With that said, I have personally experience some problems too when using external libraries, like random closing of testcomplete. So to achieve this goal right now, I'd suggest looking into using the Sys.OleObject["Excel.Application"] object to interact with your spreadsheets.