Finding element using Xpath worked in IE9 but not in IE11 - selenium

Attached is the HTML SS I am trying to click a button in my application. The button text is " Reassign". Please note that there is a space before the text. The space is visible when looking in developer tool in IE9. But not in IE11. I am unable to find the element in IE11. Whereas a simple
Driver.findelement(By.xpath(".//button[text()=' Reassign']")).click()
Worked in IE9. Same statement is not working in IE11.

Instead of
Driver.findelement(By.xpath(".//button[text()=' Reassign']")).click()
you could try
Driver.findelement(By.xpath(".//button[normalize-space(text())='Reassign']")).click()
This will ignore any leading or trailing whitespaces.

Maybe using By.linkText() could help, as Microsoft may have implemented it different than By.xpath().
Try both By.linkText('Reassign') and By.linkText(' Reassign'). If neither works, try By.partialLinkText('Reassign'). This is of course not as specific, but, depending on your page, could do.

Check if the below xpath works
//div[#class='divbuttonholder margin-left-none margin- top1']/table/tbody/tr/td/button[#type='button'][#data-bind='click:$root.Reassign']

Related

scroll until the element is in view using Selenium2Library Keyword

I am using Robot Framework for my web application automation execution.I had found one such solution using Selenium Web-driver.
scroll until the element is in view using Selenium Webdriver
But I wanted to accomplish this using Robotframewrok-Selenium2Library.
Please suggest such keyword if any.
Thanks.
Finally I got the solution to my query. I have to download the ExtendedSelenium2Library from : Github_Page
then I installed it and it is working fine now.
Thanks.
ExtendedSelenium2Library solved the problem of scrolling down and selecting an element. I used the keyword 'Scroll Element Into View' for my application. However the ExtendedSelenium2Library will not work with the higher versions of the selenium2library.
Below is my 'pip freeze' command output which is working
robotframework==3.0.2
robotframework-extendedselenium2library==0.9.1
robotframework-selenium2library==1.8.0
robotframework-seleniumlibrary==2.9.2
selenium==3.8.0
urllib3==1.22
I was stuck at similar blockade and i could resolve as below:
Hope this might be of little help!
Use ExtendedSelenium2Library Library...
Example:
***Settings***
Library ExtendedSelenium2Library
*** Keywords ****
Add Your Methods
#Execute Javascript window.scrollTo(0,200);
Scroll Element Into View ${YourElement}
Wait Until Element is visible ${YourElement} timeout=5s
Set Focus To Element ${YourElement}
Click Element ${YourElement}

Mysterious FireBug Error repeats with ExtJS

When debugging ExtJS 4 (tried both versions 4.1.0 and 4.1.1), FireBug repeatedly shows the following error: An invalid or illegal string was specified
http://docs.sencha.com/ext-js/4-1/extjs/ext-all.js
Line 18. It does not break on the error, though that option is specified. Additionally, neither my code or ext-debug.js and it's loader seem to actually call ext-all.js.
This error gets logged to Firebug's console about once per minute, which is annoying. What bothers me is that I cannot get the error to go away. Is this a FireBug bug? An ExtJS bug? Aliens? How can I debug the debugger?
I had the same problem before and I've solved it by removing a special character at the end of my JS file! (app.js I think)
It was weird, but the problem came from hidden special characters like: Zero-width non-joiner or Right-to-left mark.
Open another JS file but do not copy/paste your code there. Just write it again and check whether the problem exists or not.
And don't forget to check your data if you have some. As this article explains about the problem: http://www.ashorlivs.fr/javascript-jquery/article/an-invalid-or-illegal-string-was
For general debugging see this link http://www.sencha.com/learn/debugging-ext-js-applications/
You can also use ext-all-dev.js while in development mode.
There is another excellent tool on top of firebug, at this link http://www.illuminations-for-developers.com/
PS: I still didn't figured out how to post a comment. I guess it comes when I have more points/reputation. Hence adding it as an answer. thanks.

selenium webdriver sendkeys issue on IE - frame moves/shifts

I am using webdriver with IE 9.
When I exceute a "sendkeys" on my webelement the content of the relevant frame moves/shifts upwards.
I debugged my code and the strange behaviour occurs exactly in that moment when this line is executed:
searchTerm.sendKeys(searchString);
"searchTerm" is a Webelement, which is created by the PageFactory in that class. In my case it is a "textbox".
Although it is possible to write text into my textbox, I am struggling with that strange behaviour and would like to get rid of this. The problem is that the affected frame move above other existing frame and elements...
I dont have this problem when using firefox...
Any Ideas?
Thanks in advance and best regards,
Thomas
If you're referencing to that it scrolls the content of a frame strangely, then that's something you'll have to live with. WebDriver had (and sometimes still has) serious trouble with interacting with elements when it had to scroll to them, that's why there's some aggressive scrolling involved. It should be harmless since it doesn't actually change anything.
If it really changes the page layout, then that's a problem which should be closely examined. File a bug at http://code.google.com/p/selenium/issues/entry or post some relevant testcase here.

Why do I have an error on some Flattr buttons?

I've integrated Flattr with my Dotclear blog, using the appropriate plugin, and it works fine.
Except that, from time to time, some older posts have errors and I don't understand why.
See:
http://ploum.net/post/224-gpager-03-scenes-from-a-memory-finally-free
http://ploum.net/post/86-le-repas-de-noel-en-famille
those posts have nothing special and, yet, cannot be Flattered.
Could it be an issue on Flattr side ? Do you see what can cause that problem ?
Thanks in advance,
Seems like you're both using the new 0.6 version of the Flattr JavaScript API and a quite old 0.2 version. Using two versions at the same page can probably result in some pretty strange things - I would suggest just using the newer version that is documented here: https://flattr.com/support/integrate/js
Regarding why the button show an error - here's a bit of a secret way to find out: Look at the HTML for the button iframe and look within the div-tag with a "button-wrapper"-class - there you should find an HTML-comment that states the reason for the button error.
In your case the HTML-comment in the button iframe says "ERRORS: User couldn't be found and no owner specified." - which isn't strange since the iframe's URL has "0" specified as the uid-parameter - it should be a username instead.
Your script is disrupted by doublequotes in "var flattr_tle=", you should encode them with '"'

Selenium IDE:After Recording the Application Functionalities in IDE,i use the tool to run.But,it is showing error like:

[error] Element //div[#id='divProjects']/table/tbody/tr/td[6]/i not found
i tried to use xpather,firebug inorder to find the id's and values of the object.But,it is not working for me.
please help me to solve my issue.
You can share the IDE script, it'll make easy to resolve the issue. You have to verify that you have got to the element when you are trying to perform any action on it.
Your xpath needs to be more relative. One thing you can try is to change the xpath to xpath:relative while recording in IDE. You can find this option on clicking on the dropdown