1
Vote

Menu controls are not getting identified

description

Hello Everyone,

I am debugging the CUITE project and using the record action to record the steps perform on webpage.
All the controls available on webpage are getting identified but menu controls are not get identified.
Rectangle showing the object property is not visible for menus.

Can anyone please help me why it is not showing properties for menu

HTML information is mentioned in attachments (HTMLPreview.JPG)

Thank You
Varsha

file attachments

comments

icnocop wrote Apr 16, 2013 at 9:06 AM

Hi.

Can you attach the html and sample CUITe code please?

Thank you.

VarshaMorankar wrote Apr 22, 2013 at 9:52 AM

hi

PFA files associated

Thanks
Varsha

VarshaMorankar wrote Apr 22, 2013 at 12:44 PM

Hi

Screenshot for menu control not able to recognize is also attached. refer menuScreenshot.doc
I am using CUITe_ObjectRecorder project

Thanks
Varsha

icnocop wrote Apr 23, 2013 at 6:23 AM

Hi Varsha,

Unfortunately, I cannot reproduce this issue.
The CUITe_ObjectRecorder works without issues for me; when I press the record button and then move the move over and click on the "Home" hyperlink, I see this line added:
public CUITe_HtmlHyperlink lnkHome = new CUITe_HtmlHyperlink("InnerText=Home;Title=Home");

Which version of CUITe are you using?
I am using the latest from the "Source Code" tab, changeset #25457.

Have you installed all Microsoft updates?

VarshaMorankar wrote Apr 23, 2013 at 7:06 AM

Hi icnocop,


I am also using cuite-25457 version and within that CUITe_ObjectRecorder project. I had open the CUITe.sln. Are you opening teh same solution or different one.

Which microsoft update you are referring?


Thanks
Varsha

VarshaMorankar wrote Apr 23, 2013 at 7:15 AM

I have check again and cuite is still showing "Object not identified error" Please see the screenshot attach

VarshaMorankar wrote Apr 23, 2013 at 7:28 AM

hi

Can you forward me your source code copy

Thanks
Varsha

VarshaMorankar wrote Apr 24, 2013 at 5:33 AM

Hi

It is bit urgent and hence I am replying again and again.

Is there any internal log gets created by Cuite which I can forward for the above Error?

Further Attached screenshot shows the latest update installed on my machine.

Thanks
Varsha

icnocop wrote Apr 24, 2013 at 7:11 AM

Hi Varsha,

Does the built-in Visual Studio Coded UI Test Recorder work as expected?

icnocop wrote Apr 24, 2013 at 7:30 AM

You can use the built-in Visual Studio Coded UI Test Recorder and then manually convert the generated code for use with CUITe.

You can see some sample code that the Visual Studio Coded UI Test Recorder generates and how it can be converted into less code using CUITe in questions 1 and 2 of the [FAQ](http://cuite.codeplex.com/wikipage?title=Frequently Asked Questions).

Unfortunately, I cannot reproduce the issue using the sample HTML snippets you have sent.

You can try to close the CUITe Object Recorder and then re-launch it and try again.
You can try browsing directly to the page you are interested in recording in the CUITe Object Recorder and only press the Record button right before you click on the object you'd like to record.

You can also contact me directly and send me a link to the website you are having issues with and I can try debugging it myself.

VarshaMorankar wrote Apr 24, 2013 at 9:08 AM

PFA the code I have uploaded. the menu from Main page are not getting identified

Thanks
Varsha

VarshaMorankar wrote Apr 24, 2013 at 9:27 AM

hi

I have tried the way you have mentioned above but still not getting result.

I have uploaded the source code of application containing menu(webapplication1.zip). Can you try on that. Further can you please send me the cuite code or Form1.cs form from Cuite_objectRecorder

Regarding the object not getting identified, I think when I move mouse on menu it is not firing a java script written in get script function. That means only for menu event handle mention below is not getting associated

private void btnRecord_Click(object sender, EventArgs e)
    {
        if (doc == null)
        {
            this.toolStripStatusLabel1.Text = "Error: Document not loaded yet, please try again!";
            return;
        }
        if (this.btnRecord.Checked == true)
        {
            this.toolStripDropDownButton1.Enabled = true;
            doc.Click += new HtmlElementEventHandler(webBrowser1_ClickHandler);
            doc.GetElementsByTagName("head")[0].AppendChild(getScript(doc));
            string getwindowtitleFunction = languageIsVB ? "getWindowTitleVB" : "getWindowTitle";
            string sWindowTitle = (string)doc.InvokeScript(getwindowtitleFunction);
            if (!this.listBox1.Items.Contains(sWindowTitle)) this.listBox1.Items.Add(sWindowTitle);
            foreach (HtmlWindow frame in doc.Window.Frames)
            {
                HtmlDocument frameDoc;
                try
                {
                    frameDoc = frame.Document;
                }
                catch (UnauthorizedAccessException)
                {
                    continue;
                }
                frameDoc.GetElementsByTagName("head")[0].AppendChild(getScript(frameDoc));
                frameDoc.Click += new HtmlElementEventHandler(webBrowser1_ClickHandler);
            }
        }
        else
        {
            this.toolStripDropDownButton1.SelectedIndex = 0;
            this.toolStripDropDownButton1.Enabled = false;

icnocop wrote Apr 25, 2013 at 5:18 AM

Hi Varsha,

Thank you for uploading the code; I am able to reproduce the issue.

After some experimentation, I discovered that making either one of the changes indicated here will resolve the issue.

VarshaMorankar wrote Apr 26, 2013 at 5:17 AM

Hi

Thank you for the support. Yes after implementing this changes now it started recognizing menu controls. But I can not tell the Application to change for Cuite to Work.
Is there any solution available which I can do in Cuite code instead of Any application (web site)

Or else can I render the page when It loads in cuite browser

Thanks
Varsha

VarshaMorankar wrote Apr 26, 2013 at 5:41 AM

Hi

Further can you tell me why control is not getting recognized when it loaded as Liste view and started recognizing when it load as table

Thanks
Varsha

icnocop wrote Apr 26, 2013 at 5:59 AM

Hi Varsha,

I think the CUITe Object Recorder is not able to detect the HTML elements because when the mouse moves over each element, the Recorder tries to dynamically surround the HTML control with a div element to display the orange box, and I'm thinking that it causes issues when trying to surround ui/li elements with a div element because it might become invalid HTML and so the web browser does not render the div at all, causing the click action to experience this unexpected behavior.

If you cannot perform these changes, than I recommend using the built-in Visual Studio Coded UI Test Recorder and then manually convert the generated code for use with CUITe as mentioned earlier.

You can see some sample code that the Visual Studio Coded UI Test Recorder generates and how it can be converted into less code using CUITe in questions 1 and 2 of the FAQ.