Click here to Skip to main content
15,890,506 members
Home / Discussions / C#
   

C#

 
Question"Checked" property for ToolStripDropDownButton? Pin
la0118-Jan-09 12:38
la0118-Jan-09 12:38 
AnswerRe: "Checked" property for ToolStripDropDownButton? Pin
CodingYoshi18-Jan-09 19:32
CodingYoshi18-Jan-09 19:32 
QuestionMath Analysis Pin
nike_arh18-Jan-09 10:45
nike_arh18-Jan-09 10:45 
AnswerRe: Math Analysis [modified] Pin
Luc Pattyn18-Jan-09 10:57
sitebuilderLuc Pattyn18-Jan-09 10:57 
Questionint? VS int Pin
Mohammad Dayyan18-Jan-09 10:20
Mohammad Dayyan18-Jan-09 10:20 
AnswerRe: int? VS int Pin
Reza Raad18-Jan-09 10:26
Reza Raad18-Jan-09 10:26 
GeneralRe: int? VS int Pin
Mohammad Dayyan18-Jan-09 10:30
Mohammad Dayyan18-Jan-09 10:30 
QuestionWeb Browser Automation and WebBrowserReadyState.Complete cannot view redirect page Pin
JoeJankowski18-Jan-09 9:43
JoeJankowski18-Jan-09 9:43 
Hi guys,



I am working on a tool to test a website. Here is a short version of the code to highlight where I am having issues:


namespace Tao
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

public string Refresh()
{
this.webBrowser1.Url = new System.Uri("www.someURL.com", System.UriKind.Absolute);
while (webBrowser1.ReadyState != WebBrowserReadyState.Complete)
{
Application.DoEvents();
}
string PageText = this.webBrowser1.DocumentText.ToString();
return PageText;
}

public void button1_Click(object sender, EventArgs e)
{
string Page = Refresh();
webBrowser1.Document.GetElementById("submit").InvokeMember("click");
while (webBrowser1.ReadyState != WebBrowserReadyState.Complete)
{
Application.DoEvents();
}
Thread.Sleep(5000);
}
}
}




I have removed a lot of code to simplify this post. Basically, the form has a button that starts a loop around the browser refresh and the button click for submit. When the Refresh() object executes, because of the WebBrowserReadyState.Complete & DoEvents() objects, the webpage loads completely before the submit button is clicked. My problem is that I cannot get the brower to wait after I send the click element before the refresh action executes again. To be more clear, I hear it submit the click command, but the page does not refresh to the redirected page either before, during, or after the Thread.Sleep(5000) executes. I would like to see the redirect page after I click submit and I would like it to fully load before I execute the entire loop again. Can someone please suggest how I can make this happen?

If this description needs to be clarified, please chime in and thank you for anyone that can help me with this,

Joe
QuestionImage size Pin
Blue_Boy18-Jan-09 8:02
Blue_Boy18-Jan-09 8:02 
AnswerRe: Image size Pin
Ravi Bhavnani18-Jan-09 8:09
professionalRavi Bhavnani18-Jan-09 8:09 
AnswerRe: Image size Pin
Luc Pattyn18-Jan-09 8:13
sitebuilderLuc Pattyn18-Jan-09 8:13 
GeneralRe: Image size Pin
Blue_Boy18-Jan-09 9:09
Blue_Boy18-Jan-09 9:09 
GeneralRe: Image size Pin
Luc Pattyn18-Jan-09 9:10
sitebuilderLuc Pattyn18-Jan-09 9:10 
QuestionWindows 7, SetWindowPos, and AnimateWindow Pin
brian.shapiro18-Jan-09 6:10
brian.shapiro18-Jan-09 6:10 
QuestionWhy is this not CLS compliant? Pin
#realJSOP18-Jan-09 2:48
mve#realJSOP18-Jan-09 2:48 
AnswerRe: Why is this not CLS compliant? Pin
Nicholas Butler18-Jan-09 3:46
sitebuilderNicholas Butler18-Jan-09 3:46 
GeneralRe: Why is this not CLS compliant? Pin
#realJSOP18-Jan-09 4:38
mve#realJSOP18-Jan-09 4:38 
GeneralRe: Why is this not CLS compliant? Pin
Nicholas Butler18-Jan-09 5:29
sitebuilderNicholas Butler18-Jan-09 5:29 
QuestionProgramming Web In C# Pin
trinm198718-Jan-09 1:56
trinm198718-Jan-09 1:56 
Questiondrawing gone Pin
staticv18-Jan-09 0:49
staticv18-Jan-09 0:49 
AnswerRe: drawing gone Pin
Mustafa Ismail Mustafa18-Jan-09 0:56
Mustafa Ismail Mustafa18-Jan-09 0:56 
GeneralRe: drawing gone Pin
staticv18-Jan-09 1:19
staticv18-Jan-09 1:19 
GeneralRe: drawing gone Pin
Mustafa Ismail Mustafa18-Jan-09 1:25
Mustafa Ismail Mustafa18-Jan-09 1:25 
GeneralRe: drawing gone Pin
Colin Angus Mackay18-Jan-09 1:34
Colin Angus Mackay18-Jan-09 1:34 
GeneralRe: drawing gone Pin
Guffa18-Jan-09 1:57
Guffa18-Jan-09 1:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.