In selenium,if element id=“tagName”,then unknown error: a.tagName.toUpperCase is not a function

723 views
Skip to first unread message

SAI VINAY

unread,
Jun 1, 2017, 12:36:56 AM6/1/17
to Selenium Users

A Web element of an Angular JS Web Application in a DOM looks like

 <input id="tagName" class="form-control ng-touched " type="text" _ngcontent-c29="" name="tagName" pattern="^(?!\s*$)[^\/]+" required=""/>

When I try to submit the form through selenium WebDriver containing the above element in a web application we are getting the below error-

 java.lang.AssertionError: unknown error: a.tagName.toUpperCase is not a function

We are facing the same issue even in Selenium2.53 with Firefox and Selenium3.4 with Chrome combinations.

We tried clicking the elements with JavaScript executor also but did not work.


We have tried feeding the element with the below snippets of code. 

WebElement we = driver.findElement(By.id("tagName"));

JavascriptExecutor jse= (JavascriptExecutor) driver; jse.executeScript("arguments[0].value='Hello';", we);

We can see the value is getting entered into the field but the application is not recognizing that the value is entered.It is showing the error as "value is required". When we interpret the automation using breakpoint and enter text manually in the element no error comes.

There is also similar open issue in the below link.https://bugs.chromium.org/p/chromedriver/issues/detail?id=767

Please let us know whether there is any method to get rid of the error without changing the id value of the element in the DOM.

thi...@thoughtworks.com

unread,
Jun 5, 2017, 2:30:14 AM6/5/17
to Selenium Users
Hi,

Is there any reason why you are using Selenium instead of Protractor for angularJS apps?Selenium is not fully compatible to work with Angular elements..

Its little unclear of what you are trying to do..Are you entering a text to the element and then asserting the value of the text?What is the action your trying to do?

Krishnan Mahadevan

unread,
Jun 5, 2017, 2:39:46 AM6/5/17
to seleniu...@googlegroups.com

@Thivya

Isnt Protractor meant to be a JavaScript binding ? I believe the OP is trying to work with Java and not JavaScript.

 

 

Thanks & Regards

Krishnan Mahadevan

 

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"

My Scribblings @ http://wakened-cognition.blogspot.com/

My Technical Scribbings @ http://rationaleemotions.wordpress.com/

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/1cc27e78-1262-4e3c-abe4-4b5e8cd97d0d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Thivya Lakshimi Easwarasekaran

unread,
Jun 5, 2017, 2:54:07 AM6/5/17
to seleniu...@googlegroups.com
Protractor is primarily for AngularJS applications..
I'm not able to understand the action being performed.Java/Javascript is fine with me.

Thivyalakshimi Easwarasekaran
Quality Analyst
Emailthi...@thoughtworks.com
Telephone+91 9789805026
ThoughtWorks

To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "Selenium Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/selenium-users/7rlDgxRQXcU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/8DE721E1-53E6-4FEE-9ED7-0A8EEC3CE2B1%40gmail.com.

Joel Delumen

unread,
Jan 25, 2018, 4:20:27 AM1/25/18
to Selenium Users
Its a web driver issue. try calling other browser or update your driver, then run test again.

To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "Selenium Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/selenium-users/7rlDgxRQXcU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.

dixit.vu...@gmail.com

unread,
Feb 9, 2018, 4:18:06 AM2/9/18
to Selenium Users
I am facing the same issue in protractor also. Can you tell me the solution if you find the answer for this problem


On Thursday, June 1, 2017 at 10:06:56 AM UTC+5:30, SAI VINAY wrote:
Reply all
Reply to author
Forward
0 new messages