Tom*_*nik 3 javascript blueprism rpa
可有人告诉我,我怎么能在蓝棱镜,获取数据到数据项在导航阶段使用行动从网页Invoke JavaScript
或Insert JavaSript fragment
?
例如我正在使用函数:
function myFunction()
{var x=document.getelementById("demo").innerHTML;
return x;}
Run Code Online (Sandbox Code Playgroud)
我想将此返回值放入 Blue Prism 中的数据项中进行处理。
不幸的是,没有快速的方法来做到这一点,但是有一个非常简单的解决方法。
您需要在 JavaScript 和 Blue Prism 之间创建一座“桥梁”,这两种技术都可以与之交互。在这种情况下,最简单的桥梁是 HTML 文本框。
JavaScript 可以在页面上创建和写入一个临时的、不可见的文本框,而 Blue Prism 可以监视它并从中读取。
我使用以下脚本添加文本框和/或清除其值...
if (document.getElementById("JSOutput") == null){
// Add invisible textbox
var body = document.getElementsByTagName("body")[0];
var text = document.createElement("input");
text.id = "JSOutput";
text.style.display = "none";
body.insertBefore(text, body.firstChild);
}
else {
// Clear invisible textbox
document.getElementById("JSOutput").innerText = "";
}
Run Code Online (Sandbox Code Playgroud)
...然后下面的脚本写一些东西给它。
var output = document.getElementById("JSOutput");
output.innerText = "Hello World!"
Run Code Online (Sandbox Code Playgroud)
然后,您可以监视或手动将元素添加到应用程序建模器中: