Skip to content
This repository has been archived by the owner on Nov 29, 2018. It is now read-only.

Selenium 2 beta 3 C# -not able to click on link which is in a nested frame and table #1471

Closed
lukeis opened this issue Mar 2, 2016 · 11 comments

Comments

@lukeis
Copy link
Member

lukeis commented Mar 2, 2016

Originally reported on Google Code with ID 1471

What steps will reproduce the problem?
This is how my html is

<frame> 
: 
: 
: 
<Table id="Node4"> 
<TBODY> 
<TR NodeIdx="4"> 
<TD><SPAN style="WIDTH: 25px"></SPAN></TD> 
<TD align=right><SPAN style="WIDTH: 20px"><IMG 
onclick=ExpandNode(1)src="http://64r2mac7/businessadministrator/IMAGES/ 
ftv2node.gif"></SPAN></TD> 
<TD><IMG src="http://64r2mac7/businessadministrator/Images/User.gif"></ 
TD> 
<TD style="CURSOR: hand" id=NORMID ondblclick=dblClick=1;ExpandNode() 
onclick=CustomCall(1)><NOBR>Users</NOBR></TD> 
<TD id=CMDID><NOBR>&nbsp;&nbsp;</NOBR></TD></TR></TBODY> 
</Table> 

<frame>

Selenium 2 beta 3 code: (This code does not work) 
driver.SwitchTo().Frame("LeftFrame").FindElement(By.XPath("// 
table[@id='Node4']/tbody/tr[@NodeIdx='4']/td[@id='NORMID']")).Click(); 

There is no error throw but the click action is not performed it 
looks like it is not invoking onclick method. 

but 
getting i am able to retrieve the text value 
driver.SwitchTo().Frame("LeftFrame").FindElement(By.XPath("// 
table[@id='Node4']/tbody/tr[@NodeIdx='4']/td[@id='NORMID']")).Text; 

Not sure if it has got to do with click inside nested iframe. There 
are other pages where there is onclick where there is no iframe and 
Clicking on the element works. 

My page is built like this 

Frameset 
   frame 
   FrameSet 
      frame->name = LeftFrame 
         HtmlTable

What is the expected output? What do you see instead?

In Selenium 1 this code works

Selenium 1 Code:(this code works) 
    selenium.SelectFrame("name=LeftFrame"); 
    selenium.Click("xpath=//table[@id='Node4']/tbody/tr[@NodeIdx='4']/ 
td[@id='NORMID']");

even if i extend the xpath to NOBR even then the click action is not invoked.

What version of the product are you using? On what operating system?

Selenium 2 beta 3 C# VS 2010 windows 7 IE8. The application i work on only works in
IE

Please provide any additional information below.

Reported by t1279k on 2011-03-28 17:45:41

@lukeis
Copy link
Member Author

lukeis commented Mar 2, 2016

The HTML snippet is descriptive, but could you please provide a full set of stripped-down
HTML pages that reproduce the error? I strongly suspect the problem is in the calculation
of coordinates for elements existing in frames, however, without a full set of pages
that reproduce the error, it will be next to impossible to debug.

Reported by james.h.evans.jr on 2011-03-29 12:45:44

  • Status changed: NeedsClarification

@lukeis
Copy link
Member Author

lukeis commented Mar 2, 2016

Hi James

I have been trying to get a stripped down html but in that the code works. Would you
be open to have a remote session have a look at my application.

Thanks
TK

Reported by t1279k on 2011-04-19 08:54:05

@lukeis
Copy link
Member Author

lukeis commented Mar 2, 2016

Closing issue with status NeedsClarification for > 2 months.

Reported by jari.bakken on 2011-07-04 15:07:49

  • Status changed: WontFix

@lukeis
Copy link
Member Author

lukeis commented Mar 2, 2016

Hi James

Sorry for the delay. I have attached a sample app where you can reproduce. It look
like not a problem with Frames but with the way CSS is defined. Please find attached
files. Hope this can be fixed in the next iteration. Looking forward for the fix

Thanks
TK

Reported by t1279k on 2011-07-07 13:02:57


- _Attachment: [LoginPage.zip](https://storage.googleapis.com/google-code-attachments/selenium/issue-1471/comment-4/LoginPage.zip)_

@lukeis
Copy link
Member Author

lukeis commented Mar 2, 2016

Also i have checked in RC3 also it the problem still exits

Reported by t1279k on 2011-07-07 13:05:03

@lukeis
Copy link
Member Author

lukeis commented Mar 2, 2016

Here is the script i used
using System;
using System.Collections.Generic;
using System.Text;
using OpenQA.Selenium;
using OpenQA.Selenium.IE;

namespace Selenium2RC3_ConsoleApp
{
    class Program
    {
        static void Main(string[] args)
        {

            IWebDriver driver = new InternetExplorerDriver();

            driver.Navigate().GoToUrl("http://localhost/frame/login.asp");
            driver.FindElement(By.Name("LoginId")).SendKeys("testuser");
            driver.FindElement(By.Name("Passwd")).SendKeys("test");
            //string val = driver.FindElement(By.XPath("//table[1]/tbody/tr[10]/td[3]/span/nobr")).Text;
            //string val2 = driver.FindElement(By.Name("loginbtn")).Text;
            //driver.FindElement(By.XPath("//table[1]/tbody/tr[10]/td[3]/span/nobr")).Click();
            driver.FindElement(By.Name("loginbtn")).Click();


        }
    }
}

Reported by t1279k on 2011-07-07 13:07:27

@lukeis
Copy link
Member Author

lukeis commented Mar 2, 2016

Reported by dawagner on 2011-07-07 14:35:44

  • Status changed: New
  • Labels added: browser-ie

@lukeis
Copy link
Member Author

lukeis commented Mar 2, 2016

I am unable to reproduce using your test case, and test HTML page. Please remember that
for IE, you'll need to double-check the zoom level on the browser to make sure it's
set to 100%.

Reported by james.h.evans.jr on 2011-07-07 15:56:32

  • Status changed: NeedsClarification

@lukeis
Copy link
Member Author

lukeis commented Mar 2, 2016

Hi James

Thanks for pointing out the zoom level. Everything works fine this issue can be closed.
Thanks for you help

Reported by t1279k on 2011-07-08 10:07:19

@lukeis
Copy link
Member Author

lukeis commented Mar 2, 2016

Fixed with proper configuration of the browser.

Reported by james.h.evans.jr on 2011-07-08 10:11:50

  • Status changed: Fixed

@lukeis
Copy link
Member Author

lukeis commented Mar 2, 2016

Reported by luke.semerau on 2015-09-17 18:12:32

  • Labels added: Restrict-AddIssueComment-Commit

@lukeis lukeis closed this as completed Mar 2, 2016
@SeleniumHQ SeleniumHQ locked and limited conversation to collaborators Mar 4, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant