07-16-2015, 01:13 PM
I'm not really sure if the latest UFT version supports MongoDB. You may refer the product availability matrix (PAM.pdf) for the same. However, here is a workaround if it doesn't.
You can connect to MongoDB using .net/java languages since there are drivers for it.
Create a java jar which exposes methods like connect, execute, disconnect etc on MongoDB and call them from vbscript. This jar should also save the output of a query to excel. You can then invoke this jar or (executable jar) from command prompt and have the output sent to excel which can be used furthur for validations.
You can connect to MongoDB using .net/java languages since there are drivers for it.
Create a java jar which exposes methods like connect, execute, disconnect etc on MongoDB and call them from vbscript. This jar should also save the output of a query to excel. You can then invoke this jar or (executable jar) from command prompt and have the output sent to excel which can be used furthur for validations.
Code:
Systemutil.Run "cmd.exe"
Window("object class:=ConsoleWindowClass").Maximize
window("object class:=ConsoleWindowClass").Type "cd <location of executable jar"
window("object class:=ConsoleWindowClass").Type <excutablejar.jar>
window("object class:=ConsoleWindowClass").Type micReturn