Selenium selectWindow does not find window opened with openWindow - selenium

in Selenium IDE on FireFox 11, I use
openWindow | ${myURL} | receiverWindow
selectWindow | receiverWindow
and I get
[info] Executing: |selectWindow | receiverWindow | |
[debug] Command found, going to execute selectWindow
[debug] getWindowByName(receiverWindow)
[debug] getWindowNameByTitle(receiverWindow)
[error] Could not find window with title receiverWindow
With FireBug, I looked into the DOM of the sucessfully opened window and found a top-level entry: seleniumWindowName | "receiverWindow"
So, it looks like selenium seems to have stored the WindowID somehow but seems to look other places than where it was stored.
I also tried
selectWindow | "receiverWindow" (with quotes) but with no success.
What am I not getting right here?

If you use the openWindowAndWait command instead of the openWindow command, does the subsequent selectWindow step succeed?
You may also need to specify ${receiverWindow} to reference the variable in the selectWindow step.

Related

File upload path with Selenium IDE

I'm trying to upload files into Selenium IDE, I had read many forum posts but cannot find something working... So I'm searching for some help.
I'm testing a web app in which I need to upload pictures and videos.
In my scénario, i'm pressing a button which open a local file browser and select a file.
I've put video sample at the root of my test folder in which there's my .side file.
In Selenium IDE i've tried :
| Command | Target | Value |
| type | id=importType| sample.mp4 |
| type | id=importType| /rel_path_from_side_file/sample.mp4 |
| type | id=importType| /absolute_local_path/sample.mp4 |
During the test execution, the button is clicked and the file browser opens but I have to click manually on the sample.mp4 file to make test succeed so it's not automated at all.
I would like to automate this part of the test to use it in our CI/CD process.
If anyone sees my mistake or knows the solution, it would be awesome.
Thank you
Best regards
Brutal

Spoon doesn´t launch

I've already set all the environment variables but my Spoon.bat still doesn´t launch, even though it seems to warn no errors.
When I execute the Spoon.bat the window closes in less than 1 second and shows only these 3 lines.
DEBUG: Using PENTAHO_JAVA_HOME
DEBUG: _PENTAHO_JAVA_HOME=C:\Program Files\Java\jdk1.8.0_333
DEBUG: _PENTAHO_JAVA=C:\Program Files\Java\jdk1.8.0_333\bin\javaw.exe
I would try running from a command prompt and run SpoonDebug.bat instead. The window should remain open and any additional information should be displayed.

Selenium IDE - waitForTextPresent

I have a problem with Selenium IDE's command - waitForTextPresent.
<tr>
<td>waitForTextPresent</td>
<td>*saved successfully</td>
<td></td>
</tr>
I had a couple of tests which are using this command. All tests worked fine, but now, during executing this command web application freeze, after while Firefox crashed, whole Firefox freezed and i received from Selenium IDE timeout exception after a while. So my question is, why is it happening?
I didn't change tests or selenium settings.
One time I received error:
A script on this page may be busy, or it may have stopped responding. You can stop the script now, open the script in the debugger, or let the script continue.
Script: chrome://selenium-ide/content/…nium-core/scripts/htmlutils.js:679
Windows 7
Firefox 38.0.5
Selenium IDE: 2.8.0
I am using couple of add-ons related to Selenium (e.g.: Sel Block).
waitForTextPresent is a deprecated command, try using just waitForText with a CSS locator as the target, and the '*saved successfully' bit as the value.
Update:
You can use XPath for detecting the contained text as well For example:
waitForElementPresent | //*[#id="objectid" and contains(text(),"Text You Want")]
Older solution with waitForText:
You have to use WaitFortext
waitForText | Locator | Textpattern
for example
waitForText | //* | *saved successfully
asterisk can be used on beginning, middle or end of the text pattern

Selenium and Jenkins, test suite works in commandline not on jenkins

I've got a Selenium stand alone server, I run a simple test suite with a simple test case in command line and it works, here is the command line :
java -jar D:\POC\selenium-server-standalone-2.45.0.jar -Dhttp.proxyHost=XXXX -Dhttp.proxyPort=8080 -Dhttp.proxyUser=XXXX -Dhttp.proxyPassword=XXXX -htmlSuite *firefox http://XXXXX D:\Users\XXXX\Desktop\test_selenium.html D:\Users\XXXX\Desktop\result_selenium.html -firefoxProfileTemplate "C:\Users\XXXXX\AppData\Roaming\Mozilla\Firefox\Profiles\1yd4vpna.selenium" -debug
The same command is used by jenkins to run the test, here is the selenium result file :
info: Starting test /selenium-server/tests/test_case_selenium.html
info: Executing: |open | /index.php/fr/ | |
warn: currentTest.recordFailure: Timed out after 30000ms
info: Executing: |clickAndWait | css=li.item-175.first > a.subMenuBtn > span | |
error: Element css=li.item-175.first > a.subMenuBtn > span not found
warn: currentTest.recordFailure: Element css=li.item-175.first > a.subMenuBtn > span not found
When I read command line logs, Jenkins and commandline are different from firefox launch. On command line I can see a firefox poping, not with jenkins.
Without -debug, jenkins stops at "checking resource aliases".
I launched tomcat for jenkins as admin, still got my problem.
Any ideas?
From the paths being referenced, it looks like your Selenium server is in a Windows environment.
Since Selenium interacts with the desktop, make sure that the user account your Jenkins service is running under has the appropriate permissions to do that. (ie, run it as a named account and give that account access to the desktop via Computer Management / Services).
That would explain why you're seeing different behaviour running from the command line (as your user account) compared to in Jenkins (as the Jenkins service user account).
You can try js-code to fix this error. JS-redirect. As:
storeEval window.location="http://yourWebsiteToOpen.com"; js
echo ${js}
At least It helped for us.

I want to delete specific record in localStorage in Selenium

I am trying to do the following in Selenium IDE in Firefox:
I have a key named dismissGraphHelp in my localStorage.
I am trying to remove it in the script, but it does nothing.
getEval (with target) localStorage.removeItem('dismissGraphHelp');
How to achieve deleting the key?
If it would be possible, I would love to purge everything the localStorage.
OK, found it.
To purge the localStorage under Selenium IDE/Firefox I did the following:
Command: getEval
Target: window.localStorage.clear();
In the latest version of Selenium IDE this appears to have changed from getEval to run script. The command is still as Kokesh posted above.
Command: run script
Target: window.localStorage.clear();