read data from a database or text file in instruments javascript script

馋奶兔 提交于 2019-12-01 09:01:48

Yes it is possible. You can acquire every data that you are able to acquire in a bash script. Write a script file that prints the desired information to the standard output. For example

#!/bin/bash
cat myfile

You can run this bash-script from UIAutomation and get the output of it with this command

var result = target.host().performTaskWithPathArgumentsTimeout(full_path_to_your_script, [""], 10);

Now your can use the output of your bash script:

element.setValue(result.stdout);
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!