Click here to Skip to main content
15,891,184 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Hello

I am writing a macro where it will login to a secure website ex:https:\\ww.some website.logon.aspx after login I need to select particular tab , in that form I need to give two inputs..which has one textbox and one combo box and then submit...the search result of this need to be copied.


Here is my code

Dim ie as object
Dim myUrl as string
myUrl ="https:some website.com" //cloud based website

Set ie = new InternetExplorer
Ie.visible = True
Ie.navigate myUrl
Do
Loop until ie.readystate= readystate_complete
Ie.document.forms(0).all.(username).value = "username"
Ie.document.forms(0).all.(passwd).value = "password"
Ie.document.forms(0).submit

//I am able to open the website and login ......don't know how to proceed further...I need to know how to switch to particular tab which I want.

And how to input data to that textbox and combobox?

In source code of website I took its tag name and tried to insert...but its not taking input...

Can it be possible to do ?

Thanks for ur help

What I have tried:

Here is my code

Dim ie as object
Dim myUrl as string
myUrl ="https:some website.com" //cloud based website

Set ie = new InternetExplorer
Ie.visible = True
Ie.navigate myUrl
Do
Loop until ie.readystate= readystate_complete
Ie.document.forms(0).all.(username).value = "username"
Ie.document.forms(0).all.(passwd).value = "password"
Ie.document.forms(0).submit

//I am able to open the website and login ......don't know how to proceed further...I need to know how to switch to particular tab which I want.

And how to input data to that textbox and combobox?

In source code of website I took its tag name and tried to insert...but its not taking input...

Can it be possible to do ?

Thanks for ur help
Posted
Comments
Member 14834621 18-May-20 0:35am    
how to select add child option in this web which code in below


<title>
National Health Mission (MP)










//<![CDATA[
var theForm = document.forms['aspnetForm'];
if (!theForm) {
theForm = document.aspnetForm;
}
function __doPostBack(eventTarget, eventArgument) {
if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
theForm.__EVENTTARGET.value = eventTarget;
theForm.__EVENTARGUMENT.value = eventArgument;
theForm.submit();
}
}
//]]>








//<![CDATA[
if (typeof(Sys) === 'undefined') throw new Error('ASP.NET Ajax client-side framework failed to load.');
//]]>












//<![CDATA[
Sys.WebForms.PageRequestManager._initialize('ctl00$ToolkitScriptManager1', 'aspnetForm', [], [], [], 90, 'ctl00');
//]]>



//<![CDATA[
function HandleClose() {
alert("Killing the session on the server!!");
PageMethods.AbandonSession();
}
//]]>



function DisplayMenu(arg1, arg2) {
if (arg1 == 1) {
//show left menu
document.getElementById("ctl00_divMenuOpen").style.display = "none";
document.getElementById("ctl00_divCollapMenu").style.display = "block";
document.getElementById("ctl00_mainDivContant1").style.width = "82%";
}
else {

document.getElementById("ctl00_divMenuOpen").style.display = "block";
document.getElementById("ctl00_divCollapMenu").style.display = "none";
document.getElementById("ctl00_mainDivContant1").style.width = "97%";
} if (arg2 == 1)
{ return true; }
else
{ return false; }
}
function confirmalert() {
var ans = confirm("Are you sure you want to Logout?");
if (ans == true) {
return true;
}
else {
return false;
}
}
function StoreFileName() {

document.getElementById('ctl00_ContentPlaceHolder1_tcDepartment_tpUser_hfFilePath').value = document.getElementById('ctl00_ContentPlaceHolder1_tcDepartment_tpUser_imageUpload').value;
var file = document.getElementById('ctl00_ContentPlaceHolder1_tcDepartment_tpUser_hfFilePath').value.toLowerCase();
var ext = file.substring(file.lastIndexOf(".") + 1, file.length);
if (ext == "png" || ext == "jpg" || ext == "gif") {//alert('ok');
return true;
}
else if (ext != "") {
alert("Only 'png', 'jpg', 'gif' extensions are supported");
return false;
}

}
function logoutAlert() {
alert('Logout Successfully');
}






function MakeStaticHeader(gridId, height, width, headerHeight, isFooter) {
var tbl = document.getElementById(gridId);
if (tbl) {
var DivHR = document.getElementById('DivHeaderRow');
var DivMC = document.getElementById('DivMainContent');
var DivFR = document.getElementById('DivFooterRow');

//*** Set divheaderRow Properties ****
DivHR.style.height = headerHeight + 'px';
DivHR.style.width = (parseInt(width) - 16) + 'px';
DivHR.style.position = 'relative';
DivHR.style.top = '0px';
DivHR.style.zIndex = '10';
DivHR.style.verticalAlign = 'top';

//*** Set divMainContent Properties ****
DivMC.style.width = width + 'px';
DivMC.style.height = height + 'px';
DivMC.style.position = 'relative';
DivMC.style.top = -headerHeight + 'p

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900