VBA关闭Java提醒弹出窗口,名称为“来自网页的消息” [英] VBA Close Java Alerts Popups with name "Message from webpage"

查看:1226
本文介绍了VBA关闭Java提醒弹出窗口,名称为“来自网页的消息”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我可以在网页中浏览和输入数据,但是当选择不同的项目来更新模态时警告显示..



如何点击确定按钮tru VBA?



任何帮助请...



这是网页中的代码,我认为在我选择触发警报的项目时触发。



这是我在HTML脚本中看到的:

  function onUpdatedShowAlertTS(varControl){


if(varControl ==ddlProjectStatus){
var varconfirm = document.getElementById('ctl00_Tabs_pnlCaptureTSMetrics_CaptureTSMetrics_hdnReleaseStatusConfirmation');
if(varconfirm.value ==true){
var varControlId = document.getElementById('ctl00_Tabs_pnlCaptureTSMetrics_CaptureTSMetrics_ddlProjectStatus');
var value = varControlId.options [varControlId.selectedIndex] .innerText;
alert('发布状态成功重置为'+ value +',验证状态为Pending。
document.getElementById('ctl00_Tabs_pnlCaptureTSMetrics_CaptureTSMetrics_hdnReleaseStatusConfirmation')。value =false;
}
}


if(varControl ==ddlReleaseName){
var varconfirm = document.getElementById('ctl00_Tabs_pnlCaptureTSMetrics_CaptureTSMetrics_hdnReleaseNameConfirmation');
if(varconfirm.value ==true){
alert('发布状态和验证状态成功重置');
var isReadOnlyStatus ='0'
if(!(isReadOnlyStatus == 1)){
document.getElementById('ctl00_Tabs_pnlCaptureTSMetrics_CaptureTSMetrics_hdnReleaseNameConfirmation')。value =false;
document.getElementById('ctl00_Tabs_pnlCaptureTSMetrics_CaptureTSMetrics_btnSaveValidate')。disabled = false;
}
}
}

这是我的代码: / p>

  ieDoc.getElementById(ctl00_Tabs_pnlCaptureTSMetrics_CaptureTSMetrics_hdnConfirmationforReleaseChange)。点击
ieDoc.getElementById(ctl00_Tabs_pnlCaptureTSMetrics_CaptureTSMetrics_hdnConfirmationforReleaseChange)。setAttributevalue ,true
ieDoc.getElementById(ctl00_Tabs_pnlCaptureTSMetrics_CaptureTSMetrics_hdnConfirmationforReleaseChange)。setAttributetype,hidden


解决方案

一个立即的解决方案是使用 SendKeys 函数。

  Application.SendKeysn'将后面的n发送到对话框

Application.SendKeys{ENTER}'将ENTER发送到对话框

您可以在 SendKeys here


Im having a problem dealing with the java scripts alerts..

I am able to navigate and enter data in the webpage but when selecting different item to update a modal alerts displayed..

How can I click the OK button tru VBA?

Any help please...

Here is the code in the webpage i think firing when i select an item triggering the alert..

This is what i see in the HTML scripts:

function onUpdatedShowAlertTS(varControl) {


if (varControl == "ddlProjectStatus") {
var varconfirm = document.getElementById('ctl00_Tabs_pnlCaptureTSMetrics_CaptureTSMetrics_hdnReleaseStatusConfirmation');
if (varconfirm.value == "true") {
var varControlId = document.getElementById('ctl00_Tabs_pnlCaptureTSMetrics_CaptureTSMetrics_ddlProjectStatus');
var value = varControlId.options[varControlId.selectedIndex].innerText;
alert('Release status is reset to ' + value + ' successfully and validation status is Pending.');
document.getElementById('ctl00_Tabs_pnlCaptureTSMetrics_CaptureTSMetrics_hdnReleaseStatusConfirmation').value = "false";
}
}


if (varControl == "ddlReleaseName") {
var varconfirm = document.getElementById('ctl00_Tabs_pnlCaptureTSMetrics_CaptureTSMetrics_hdnReleaseNameConfirmation');
if (varconfirm.value == "true") {
alert('Release status and and validation status is reset successfully.');
var isReadOnlyStatus = '0'
if (!(isReadOnlyStatus == 1)) {
document.getElementById('ctl00_Tabs_pnlCaptureTSMetrics_CaptureTSMetrics_hdnReleaseNameConfirmation').value = "false";
document.getElementById('ctl00_Tabs_pnlCaptureTSMetrics_CaptureTSMetrics_btnSaveValidate').disabled = false;
}
}
}

This is my code:

ieDoc.getElementById("ctl00_Tabs_pnlCaptureTSMetrics_CaptureTSMetrics_hdnConfirmationforReleaseChange").Click
ieDoc.getElementById("ctl00_Tabs_pnlCaptureTSMetrics_CaptureTSMetrics_hdnConfirmationforReleaseChange").setAttribute "value", "true"
ieDoc.getElementById("ctl00_Tabs_pnlCaptureTSMetrics_CaptureTSMetrics_hdnConfirmationforReleaseChange").setAttribute "type", "hidden"

解决方案

One immediate solution would be to use the SendKeys function.

Application.SendKeys "n"          ' Send the latter "n" to the dialog

Application.SendKeys "{ENTER}"    ' Send ENTER to the dialog

You can find more information on SendKeys here.

这篇关于VBA关闭Java提醒弹出窗口,名称为“来自网页的消息”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆