iPhone webdriver not locating element using CSS selector - iphone

iPhone webdriver is not able to locate DOM elements using CSS selectors. I'm running the test on iPad simulator. In news.yahoo.com, trying to select an element using findElement(By.cssSelector()).
None of the below works. I can locate the element by id and xpath but css selector doesn't work. Getting no such element exception. Is this is a known issue? Any pointer would be helpful. Thanks!
findElementByCssSelector("mediamostpopular")
or
findElement(By.cssSelector("mediamostpopular"))
or
executeScript("document.querySelector('#mediamostpopular');"));

With the Given Information I am able to see the ID #mediamostpopular.
In Selenium We can find the element given below as follows.
driver.findElement(By.id("mediamostpopular")).

Related

Sencha Architect framework error: DOM element with id X is not the same as element in the DOM. Make sure to clean up element instances using destroy()

Sencha Architect can not display anything in the preview. When I build and run my application, everything works just fine.
But inside Architect, I get the following error:
DOM element with id X is not the same as element in the DOM. Make sure to clean up element instances using destroy()
I don't know why that happens, has anyone experienced anything similar?

Protractor Testing not working

The question is related to protractor testing. I am testing an application using Protractor. I want to inspect one element but unable to get the solution. The HTML code for the element to be inspected is :
<span class="ng-binding"> Admitted(7)</span>
As in selenium we do
element(by.class....) is not possible here in protractor. So Can any one help me in this.
You can also inspect in protractor as
element(by.css('span ng-binding'))
or
element(by.css('ng-binding'));
If there are more than one element with class name "ng-binding",
then use
element.all(by.css('ng-binding'))
to inspect element.

Sweetalert: e2e testing using Protractor

I am trying to test my web application which uses SweetAlert. I am using Protractor for e2e testing.
When I tried selecting an element using
var textElement = element(by.id("newWbName"));
protractor goes into an infinite loop, saying
W/element - more than one element found for locator By(css selector, *[id="newWbName"]) - the first result will be used
as seen here, even though there is only one id with newWbName.
I am wondering if there is anything in how sweet alert renders the alert that is causing this issue? The selectors work fine when I use them on the rest of the page. Any help is really appreciated.

I'm running into an issue with JSNI that I was hoping someone could help me with.

I am using an external JS file to generate QR codes
The JS file is loading correctly, it just can't refer to that function. The specific error I am getting is:
Uncaught ReferenceError: qrcode is not defined
enter image description here
The error suggest the tag qrcode could not be found. Is it in your HTML page as id? Also as suggested in the comment you need to do new $wnd.QRCode(... in createQRCode. Also you could pass the element found as argument to the latter method and do the search getElementById in GWT code as Java and use: Document.getElementById

JStreeGrid Microsoft JScript runtime error: Object doesn't support this property or method

I'm using the JSTreeGrid in an ASP.NET application. The implementation of the JSTreeGrid works fine in the application in which it was designed in tested. However when I moved it over to another application I recieved the following error message below:
Microsoft JScript runtime error: Object doesn't support this property or method
When I initially moved the implementation over I discovered and corrected issues related to the new application forms utilizing Masterpages. The container names were concatenated to the div tags and the scripts were not finding the declared div tag IDs specified in the script. The application that I moved it from did not use Masterpages. I feel resonably certain that the error is related.
The error occurs in the _prepare_grid: function in the jstreegrid script when obj.each(function () section of script is run.
Any insight would be appreciated. Thanks
When you use master pages the Client ID of your DOM elements ia manupulated by the server.
This is due to the chace that you will use the same id both in the master page and in your derived page... when calling Jquery function i would guess that you use id selector i.e. $('#someID').doSomething() ...
When using master one of the solutions is to use the following selector as an exmaple:
$('[id$=myButton]').click(function(){ alert('button clicked'); });
This means that Jquery will select the element with an ID attribute that end with 'myButton'.
for more information follow this post.
How to use JQuery with Master Pages?