I am working on a application with nested iframes and I want to validate content of active iframe.
How to take screenshot of that active iframe?
Assuming Java is your programming language for the test,
first use switchTo() method to focus on wanted iframe:
driver.switchTo().frame(driver.findElement(By.id("frameId")))
Now regarding snapshot of the iframe, I would use ashot open source library which could help you take a snapshot of particular element. In your case, it would be the element which located in the highest level inside the iframe.
Related
The website which for which I am trying to do automation is a secure website where some functions like right clicking have been disabled. I am using the exact xpath for the login input field but it is not working. My Xpath is as follows:
driver.findElement(By.xpath("//input[contains(#class,'input')]")).sendKeys("Aa12");
SeeTest provides a way for opening the developer tools even in such cases.
They also have different versions of chrome in which you can try your scenario.
Their documentation might help you more on this.
Is it possible to click on hidden/non-visible elements, using the selenium java webdriver, without using the JavaScript executor to click via JavaScript? The tests I'm performing are in a browser with JavaScript disabled, which is why I can't use the jse.
Selenium is meant to replicate the end user's behavior. Since any end user cannot do anything with the hidden element it's not realistic to interact with hidden elements directly. See this answer.
So, the answer is No there is no way without the javascript executor. Selenium does not interact with the hidden element directly
I want to find all nodes of a web page and get the absolute position of them, how can I do this via JavaFX?!
(in other words, I want to find the absolute position of each HTML tag when it is shown by a browser, how can i do this work via JavaFX or anything else?!)
I am using JavaFX 2-2.
For more details, please see the first two comments.
I guess you need this: JavaFX WebView.
Honestly, I have no idea how to use it, but looking at examples (on same page) I can see that it uses WebKit and allows you to query all the rendered elements.
I am using the JQuery UI datepicker plugin to dynamically change some page content. I get HtmlUnit to click on the text input, which should make the datepicker popup appear. However when I call driver.findElement(By.id("ui-datepicker-month")) I get an exception - it seems anything which is newly added to the DOM by JS does not become visible to HtmlUnit.
I'm not sure if there is any way around this, but it is worth noting when I use Chromedriver I don't have this problem - I am able to find the new elements. Also the getSource() method only ever returns the original source code with HtmlUnit whereas with Chromedriver it returns the updated source.
Is there any way to support the JS using Html Unit?
I am doing an automation with Selenium Webdriver using Java. I need to click the class name inside the span tag.
Example
For this i used xpath to select class="selcteME" and used click(). This works fine if I put break point in debug mode but when I run the script without break point in debug mode object is not selected.
Please share if you have solution or suggest me how can I get the class name inside the span tag
() without xpath
Have you tried by CSS Selector?
I suggest use some IDE to generate basic test and then use your logic.