Executing seleneses in a new window does not work - selenium-ide

I am trying to execute selenese in a new window, but it seems that it doesn't work.
The simple test: open a new window, select it and click something there:
openWindowAndWait | http://cnn.com | cnn
selectWindow | cnn | |
click | link=Regions | |
The test fails and I don't know what I am missing - the click (the final command) is not executed.

I think it SHOULD work if you do this:
<tr>
<td>selectWindow</td>
<td>name=cnn</td>
<td></td>
</tr>
By specifying name=cnn (instead of just cnn) but for me, I get an error:
[error] Window does not exist. If this looks like a Selenium bug, make sure to read http://seleniumhq.org/docs/02_selenium_ide.html#alerts-popups-and-multiple-windows for potential workarounds.
but it defaults to the title of the page and as such this works for me:
<tr>
<td>selectWindow</td>
<td>Breaking News, Daily News and Videos - CNN.com</td>
<td></td>
</tr>

Related

Inject <thead> default with table in tinymce

I'm using Umbraco as the CMS, 7.6 - Umbraco.TinyMCEv3
So using insert Table will create HTML something like following
<table>
<tbody>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
How can I configure to add default <thead> when table is created
<table>
<thead>
<tr>…</tr>
</thead>
<tbody>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
Thanks
I don't know if this is all that possible; it seems as though that functionality isn't included as a setting within the editor.
The obvious thing to do if the setting isn't included is to create it yourself - the way to to do this would be to either extend the existing editor or copy and paste the editor to a new one locally.
The files for the editor are under \Umbraco\lib\tinymce
Unfortunately, it appears the angular js file associated with this editor is only available as a non-human readable minified version - likely owing to the fact that tinymce is under license. So any modification of this would be quite tricky, to say the least.
Perhaps see if there is another way around this? You can always set css to select the first child row of the table if it is for styling purposes. Otherwise the only other option would be to create your table in the editor, then choose the code edit option to manually insert the correct table structure.
I have v5 with vue.js
After created table:
1-Click right on row of head you want > row > row properties
click right on row of head>row>row properties
2-In general choose "Header" at Row type
in general select of "Header" at Row type

How can we read excelsheet data in selenium IDE

I am very new to selenium ide,How can we read excelsheet data in selenium IDE. I have searched in google but not found particular links which I wanted .I got one link where they are reading excelsheet using eclipse, junit,testNG etc. Is it possible to read data of excelsheet in selenium ide and use that data in selenium ide test cases and also i want to export my test suit result in excelsheet.
Please reply
Thank you
Though I'm late to the show, I hope the following instructions will at least be of some use to anyone looking to automate part of their workflow. The method detailed below will allow automated web form entry from data in a CSV file using only Selenium IDE.
What you'll need: 1.) Selenium IDE 2.) CSV File Reader plugin // This can be acquired at seleniumhq.org/download then proceed to download at Github 3.) Selblocks // a language extension which permits use of conditonals & looping
Now that you have the necessary tools, fire up Firefox and navigate to your Selenium IDE options. You'll want to copy the path of the File Reader (.js) to Selenium Core Extensions to enable use. With that out of the way, verify that Selblocks installed without issue by typing in "while"; if this command is recognized (i.e. auto-completes/has a reference description) then all went well. Now verify that the File reader plugin commands are accessible by typing in "readCSV"; again if it auto-completes the command that means you're good to go.
Your target for the readCSV command is the path to your file (ex: file:\C:/Test.csv). To read the entire contents of the csv file, you'll need a simple while loop. Here's a sample framework:
...
<tr>
<td>store</td>
<td>4</td>
<td>loop</td>
</tr>
<tr>
<td>store</td>
<td>1</td>
<td>p</td>
</tr>
<tr>
<td>while</td>
<td>${p}<${loop}</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>https://automatestuff.com/go </td>
<td></td>
</tr>
<tr>
<td>readCSV</td>
<td>file:\C:/Test.csv</td>
<td></td>
</tr>
<tr>
<td>storeCellValue</td>
<td>SomeData</td>
<td>${p},1</td>
</tr>
<tr>
<td>storeCellValue</td>
<td>MoreData</td>
<td>${p},2</td>
</tr>
<tr>
<td>echo</td>
<td>${SomeData}</td>
<td></td>
</tr>
<tr>
<td>echo</td>
<td>${MoreData}</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>${p}+1</td>
<td>p</td>
</tr>
....
<tr>
<td>endWhile</td>
<td></td>
<td></td>
</tr>
...
Your target value (in this example, 4) for the first store command will vary given the size of your dataset. The while expression will run through your data until it evaluates to false. In this example, I have data being read from column 1, row 1 (and so on) and column 2, but it's possible to configure more or less.
Anyway, I hope that's clear and gets you on your way to automating the mundane bits of your workflow.
You can probably hack together something for this that uses javascript to read in files, but I think you should question WHY you want to do it this way instead. Why do you need excel files or why are you limited to IDE testing?
But maybe some help on excel files & javascript: How to read an excel file contents on client side?

How can I write assertion for hidden alerts in Selenium IDE

I have to assert a hidden alert in Selenium IDE. The commands suggested by IDE failed. Below mentioned is the html tag for the error message. Thanks for the Help!
<article class="alertify-log alertify-log-error alertify-log-show alertify-log- hide">ERROR: User name and password doesn't match. Please try again.</article>
Asserts that the article is present:
<tr>
<td>assertElementPresent</td>
<td>css=article[class*='hide'][class*='alertify-log-error']</td>
<td></td>
</tr>
Asserts the text is present:
<tr>
<td>assertText</td>
<td>css=article[class*='hide'][class*='alertify-log-error']</td>
<td>ERROR: User name and password doesn't match. Please try again.</td>
</tr>

How to get the list count using selenium ide

I'm using Selenium IDE to create my tests,I am testing a ticketing system ,in one of my case i want the total count of the new listed tickets,i tried commands like "storeAllLinks" ,"storeAllFields" but i didnt get the count i needed .is there any way to get the count,please help me out.
The storeAllLinks and storeAllFields return arrays. You can use storeEval to run a .length with JavaScript on the array to count the number of items. Use the stored value as you wish, in this case I just write it out to the IDE console.
<tr>
<td>storeAllLinks</td>
<td>aLinks</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>storedVars['aLinks'].length</td>
<td>numberOfLinks</td>
</tr>
<tr>
<td>echo</td>
<td>${numberOfLinks}</td>
<td></td>
</tr>

How to parse a URL from string in selenium IDE

I am using SIDE 1.3.0 along with FF 6.0.2.
I stored a string using store text command which contains a "URL" by using the following command.
storeText
which results as
MyCode = "<iframe src="http://myportal.com/mysales/Agent/index/4eb29642ce24e8.22143850/embedded" height="650" width="605" frameBorder="0"></iframe>"
I need to have only the URL part in another variable from the string above "http://myportal.com/mysales/Agent/index/4eb29642ce24e8.22334455/embedded"
in order to proceed with the remaining test case. Thanks in advance.
Something like:
<tr>
<td>storeEval</td>
<td>'${MyCode}'.replace(/.*src="(.*?)".*/, $1)</td>
<td>url</td>
</tr>
This will use JavaScript to set a variable called url to the value of the src attribute within your MyCode variable.
The first command below stores the href attribute of any element, you can modify it to your needs.
The third command uses javascript to get the pathname attribute of the DOM object.
Hope this answers your question.
If you open the IDE click on the source tab in the main window and copy and paste the code below between the tags, you'll be able to run the test on this page, or any other stack overflow page.
<tr>
<td>storeAttribute</td>
<td>css=.profile-link#href</td>
<td>href</td>
</tr>
<tr>
<td>echo</td>
<td>${href}</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>this.browserbot.getUserWindow().document.getElementsByClassName('profile-link')[0].pathname</td>
<td>pathname</td>
</tr>
<tr>
<td>echo</td>
<td>${pathname}</td>
<td></td>
</tr>