I ve tried the latest PrimeFaces Captcha on their showcase:
https://www.primefaces.org/showcase/ui/misc/captcha.xhtml
and read an existing question on stackexchange:
How to use PrimeFaces Captcha?
I am still not sure how (and whether) the captcha on the primcefaces page does work. Whenever I click with my mouse somewhoere on it, it alsways says : "Correct" . So even I always click on one and the same place, it says "Correct". Is that all simple ?!!! Can I use the showcase in my code as it is?
Thank you
Apparently the Captcha starts to work after several cliks on it - I made maybe seven or ten clicks which were all accepted, but afterwards the capctha started to behave as a "real" captcha showing me pictures and asking me questions about the pictures.
Important: before using the primeFaces captcha on their showcase, one must update the web.xml file with two important parameters as shown here:
Primefaces 5: captcha does not work for 'javax.servlet.ServletException: Expression cannot be null'
Related
Hopefully someone can help me with a solution to my problem. I have spent the better part of the day trying nearly every solution I can find on here and through Google.
I will cut to the chase. I have a test that logs in on one screen. The second screen selects a role and moves on. I am able to get to the role selection screen, but cannot move forward as Selenium will not click the button, regardless of what I do.
The interesting thing is that this will work with the IDE, but exporting the code to java and running it with the webdriver does not work either. This part makes no sense to me as I would think the IDE export should run easily. The only difference I can see is that the webdriver pulls up a profile-less Firefox, whereas the IDE is running on my profile - not sure that this would have anything to do with it, but wanted to throw that out there.
The only difference between the first button and the second button is the autofocus command in the HTML.
<button data-submit-button="" class="btn" autofocus="" name="submit" type="submit">Go</button>
I've tried numerous solutions found throughout the web and the last thing I've tried is
new WebDriverWait(driver,120).until(ExpectedConditions.elementToBeSelected(By.name("submit")));
driver.findElement(By.name("submit")).click();
This does not work either. I have tried several variations on this and most of the time the webdriver either times out or skips through this step, passing it and then failing on the next steps as the page has not moved forward.
Does anyone have any suggestions? If you have any questions or I can give you more information if I haven't given enough! Any help with this would be amazing, as I've spent the better part of the day trying to get through this one issue.
Thanks!
Sometimes the selector is the main issue in the scenario like this. Also, name="submit" is not even a very safe selector to use since developers have tendency to duplicate the same attribute across the form. Without knowing about the actual elements I can pretty much tell you the issue is the selector. If the text Go is the only text of the button on that page, give the following xpath a shot
//button[#name='submit'][#type='submit'][contains(text(),'Go')]
Complete implementation should look like as follows:
By xpath = By.xpath("//button[#name='submit'][#type='submit'][contains(text(),'Go')]");
WebElement myDynamicElement = (new WebDriverWait(driver, 10))
.until(ExpectedConditions.presenceOfElementLocated(xpath));
myDynamicElement.click();
Is there any other way than the openpage() method? Also I guess I found a bug with that way. When I do it with openpage() I get back to the top level page but the back button on the upperleft(IOS) is shown which should not be there on a top level page - havent tried it on android yet.
openPage is the quickest way. An alternative can be to close all other open pages.
The bug sounds strange. Can you open an issue here: https://github.com/eclipsesource/tabris/issues
I'm looking for a solution to this and I have searched the web for an answer with nothing. I need a scrolling message on my webpage that can be updated by the same website but on a different page. (e.g www.webpage.com <-- has the scrolling message on it, www.webpage.com/settings <-- has a form in which you can change/update the scrolling message)
I'm pretty sure this is achievable with Java, but my knowledge on Java is slim and all my efforts have come to a fail. I have managed to get a scrolling message on my webpage and I'm sure if I could read a text file (with the message in) then assign that to a 'var', I could make that scroll but I don't know how to do that.
If you know a completely different method of doing this I am happy to change mine.
Thanks in advance,
Tom.
I would recommend javascript instead of java, since java is not really conventional anymore and looks ugly too (and requires a special plugin).
It depends on how fast you want to update the scrolling text how you want to do this. I would say save the text to a .txt or database from settings, and then have your page get it.
You can then use php to read the value from the .txt file or database to display it on your website.
If you want it to be extremely up to date you can let javasript call a little .php file that reads the file and gives you the content.
To make your text scroll you don't really need anything other than html, like so:
<marquee behavior="scroll" direction="left">Your scrolling text goes here</marquee>
You can read more about that here: http://www.quackit.com/html/codes/scrolling_text.cfm
So for this project I am doing I have a page which generates content via clickable buttons. The button posts the form to my controller and the controller acts on the button that has been clicked. To show what was changed a redirect will occur (form in the session) with an anchor included. A little piece of javascript will then go to anchor which is in the link (eg. website/add/picture#123). This works fine in pretty much every browser except Internet Explorer 7.. I found out this has to do with an input field of file type.. Because if I remove the input field, then even IE7 will nicely scroll to the anchor..
Does anyone have any idea why this behaviour occurs?
If it's unclear please tell me and I'll provide more details..
Thanks a lot,
Davey
So.. I didn't manage to solve the input type=file bug.. I suppose it's just an IE7 bug. I made a work around to put the input field on a popup. A lot of overhead but it is working pretty well now
I know this question has been asked before on S.O. and other websites but I haven't found a definite answer -- most of them say its not easily done but I wanted to make sure that was the final verdict.
Here's my situation:
I'm testing a website that is using Highcharts (http://www.highcharts.com) using Selenium WebDriver (Java).
I basically want to grab the information that is displayed in a small tooltip pop-up that appears when you hover your mouse over each datapoint on the Highchart's line graph.
Looking at the web page's HTML code, I noticed there is <g class="highcharts-tooltip".... I also noticed that, as you move your mouse, the (X,Y) values in ...transform="translate(X,Y)"> change, which then changes the information displayed in the tool tip.
Knowing this, my approach would be to somehow grab all the (X,Y) values and plug them into the transform fields and grab the tooltip data. But I don't know how to programmatically grab all the (X,Y) values through Selenium.
Has anyone tackles this issue in the past or has a better way to grab the necessary information?
I started creating a library to work with HighCharts, what I currently have is available here:
https://github.com/Ardesco/Powder-Monkey/tree/master/src/main/java/com/lazerycode/selenium/graphs
It's quite hard to provide a generic library that deals with HighCharts as the customisation options on the individual charts can modify the SVG markup quite a bit. Hopefully the above will help to a degree.
As I do more it will be updated.
The Line Charts have to have a background to work. If the chart is created with .setBackgroundColour(null), then the "rect" is not added to the html.
I was able to to add the background colour back in set to the body background colour. However I'll try and figure out a way of doing it without the "rect".