how to scroll down in another frame in selenium IDE? - selenium

I have to scroll down to load some contents in selenium IDE. But It's not in the current window. It's subframe. How do I do that?. I know this command works with current window.
<td>storeEval</td>
<td>selenium.browserbot.getCurrentWindow().scrollTo(200,200)</td>
<td></td>

Select the required frame using selectFrame(locator) command, here locator is an element locator identifying a frame or iframe. Then try to execute your scroll command.

Related

Can selenium click somewhere which is out of view

I have a code where it is identifying the button but not able to click on it ,may be because it is not in view.If we scroll it clicks.Can selenium click which is out of view
If element is on the page but not on the screen, selenium should click it without problems. Maybe your button is not on page at time of click?
I think it depends on the library you are using. E.g. nightwatch tries to scroll the element into view before clicking
.click()
Suggest edits
Simulates a click event on the given DOM element. The element is scrolled into view if it is not already pointer-interactable. See the WebDriver specification for element interactability.
https://nightwatchjs.org/api/commands/#click
I believe Mink2Selenium does not.
but if the element is not reachable by scrolling, selenium will not be able to click it, same as a user would not be able to click it. What is good, because selenium is used to do as much as possible realistic tests

Entering text with Selenium IDE in TinyMCE working when clicking 'Find' button, but not when running

I am trying to use Selenium IDE to enter text in a TinyMCE text field, and have come across some code that seems like it will work, but so far it's only half-working.
What I have is:
...
<tr>
<td>selectFrame</td>
<td>id=message_ifr</td>
<td></td>
</tr>
<tr>
<td>runScript</td>
<td>document.getElementById('tinymce').innerHTML="I am typing into the Draft Section, I hope";</td>
<td>Editor</td>
</tr>
...
When I run the first command, it selects the iFrame, but nothing happends when I run the second command, nothing happens. However, when I click the 'Find' button on the target, the text is entered in the TinyMCE text area, so it looks like it's working on some level.
Anyone see where I'm going wrong?
Code came from this page:
https://groups.google.com/forum/#!searchin/selenium-users/ide$20tinymce/selenium-users/0FBmA6TUQ4s/2kaAdeU7CgAJ
It is tricky to enter text into TimyMCE text boxes. There are two steps involved in handling this task using selenium.
Switch to the frame in which the text box is present
Using Javascriptexecutor to enter the text into the same.
Please refer to the similar link in stackoverflow.
How to input text into tinceMCE editior using selenium/webdriver
Hope this helps.
This is ugly but it will work (based on the example at https://www.tinymce.com/)
<tr>
<td>runScript</td>
<td>tinymce.setActive(tinymce.get('mce_0'));tinyMCE.activeEditor.setContent('<h1>some text</h1> TinyMCE');</td>
<td></td>
</tr>
And if you're wondering what id to use (in this example in the .get I used mce_0) you can click into your tinymce text box and then run this in the console: tinymce.activeEditor.id;

Using Selenium IDE how to navigate to URL

I'm new to selenium so I've been using the IDE to create tests. I have this problem where Selenium sees a button associated with a drop down menu, but it won't click the button. To get around this i want Selenium to type the URL (for the button i want clicked) into the address bar of fire fox, or I want selenium to just go to said URL via some command, but i can't find said command, and i can't get Selenium to click and type in the address bar.
You can use open command and type the expected url. Just right click on the command window and Insert New Command and follow the screenshot. However, you should find a better way to click the button instead.
I found the open(url) command after i posted this.
The open command would be the way to go here, but might I reccomend also adding in a store command, rather than having the script reference the URL directly. If for any reason the URL on the button changed it would mean amending the script, however if for example you went with
<tr>
<td>storeAttribute</td>
<td>id=Button-Locator#href</td>
<td>url</td>
</tr>
<tr>
<td>open</td>
<td>${url}</td>
<td></td>
</tr>
It would mean less upkeep on the script in the event of URL changes

How to automate iframe click in selenium-ide?

Also, the simple click command to the skip_intro id is failing.
Please use the selectFrame command in Selenium IDE to select the frame.
If your iframe is like <iframe id="ntbanner" width="100%" scrolling="no" height="113px" frameborder="0">
Your command will be selectFrame and the corresponding target will be id=ntbanner in IDE.
Once you are in the frame, you can click the button or elements in the frame by using normal click. If you want to get back out of the frame you can set target as null to the selectFrame command in IDE

click on script generated div in selenium

i am trying to click on a div like
[//div[24]/div/div/div/table/tbody/tr/td[3]/div/div[2]/div[2]/div[5]/div/div] .. although selenium verifies this div by verifyElementPresent and xPath is shown in xPath finder but click function of selenium does not click on it ..
selenium opens a page, i click on Customers link, script generates all the customers, then click on Details, script generates the detail page,. there i have to click on the div (Save button actually ) mentioned above ... any solution for this ???
try runScript and fire the click event with javascript
e.g. if you have jQuery on the tested script
<!--fire awkward click event-->
<tr>
<td>runScript</td>
<td>$('.bo-selector').click();</td>
<td></td>
</tr>