单击来自VBA的Javascript警报 [英] Click on Javascript Alert From VBA

查看:129
本文介绍了单击来自VBA的Javascript警报的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

朋友,

我在Web自动化的VBA代码中遇到了一些问题...

我正在尝试做的是拥有一个网站(由另一方开发..代码无法更改).我们正在尝试自动化网站的过程.
很少有诸如Web表单上的数据输入之类的字段.我们正在尝试从excel VBA代码填充此字段.我们所做的只是从Excel中获取数据并将其自动提交到网站上,然后单击Web表单上的Submit按钮.

我们能够从excel数据中获取数据,并能够在Web表单上填写数据,然后单击提交"按钮.但是单击提交按钮后,数据将被提交,并显示一个Jaavscript警报,提示数据已成功添加".

现在,我无法从VBA代码中自动单击该警报框. VBA代码在收到Alert msg并冻结了我的正常应用程序流程后,冻结了该应用程序.


任何机构都可以尝试使用VBA来单击javascript确定"警报.

Hi Friends,

I am facing some problem in VBA code with Web automation...

What i am trying to do is I have a Web site ( developed by some other party..code can''t be changed). We are trying to automate the process of web site.
There are few fields like data entry on web form. We are trying to fill this fields from excel VBA code. What we are doing just getting data from Excel and putting it on web site filed automatic and clicking the submit button on Web form.

We are able to get data from data from excel and able to fill the data on web form and click on submit button. But after clicking the submit button the data get submitted and one Jaavscript alert get displayed saying " Data added successfully".

Now i m not able to click on that alert box automatically from VBA code. VBA code freezes the application after getting Alert msg that cozes my normal flow of application.


any body tried this with VBA to click on javascript "Ok" alert.

推荐答案

您可以使用SendKey()函数从网站上单击"此消息框,但是我可以抱歉,您可以尽快将"Enter"发送给.您需要检查是否显示消息.使用 FindWindow() API函数查找此消息框.
You can "click" this messagebox from web site using SendKey() function, but i''m affraid you can send "Enter" to soon. You need to check if message is showing. Use FindWindow() API function to find this messagebox.


这篇关于单击来自VBA的Javascript警报的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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