How to type data into table rows in selenium ide? - selenium

Right now I am trying to use selenium ide to write code that makes sure web pages on a website work. On one particular page there is a table that has text boxes in each cell. You can add a row by clicking a button. What I want to do on this page is type data into the first two rows. I used selenium ide and recorded me typing in data. Then I tried to replay it. It worked fine until it came to the second row. The second row it could not write data to. The first row text boxes had targets of terms[] and defs[] . the second row looks the exact same but has targets of //td[#id='autoDefinerTd']/textarea and //table[#id='termList']/tbody/tr[3]/td[3]/textarea . I am completely stumped on what to do to fix this and why they are different. If someone could help me I would be so grateful.
Thanks in adavnce.

I figured out you just do it the normal way. For some reason selenium was doing it a weird way.

Related

User input range for XY graph

I'm a beginner user of labview so bear with me, please. I'm working on a project that takes a data text file with columns and rows as an input. I have the project set up so far to take the data from that file and display it in an XY graph.
I want to add a feature where the user inputs a set of values that represent a range in the x-scale. The program should take those two values and make a new graph (or use the old one, that works too) with the proper scale.
I greatly appreciate your time and help .
Thanks
Edit :
A snippet of the txt file.
The red arrow shows what I tried to use from the help section of labview. Yet I have little to no idea on how to integrate it into my diagram or vet if its the right tool to use.
These numeric values input in the front panel is what I thought could work, but I'm all ears to any suggestions.
You already found the correct property node value :)
You have to connect a minimum and a maximum value to the property node. If you click on the function on the node, you can select the min and max option.
I made this little example for you to see what you need to do.
Property nodes are in genereal very useful as you can set and change so many settings programatically.
A nice feature of LabVIEW: You can drag&drop .png pictures in your Block Diagram. So if you want to test my VI-Snippet, just drag&drop it :)
I hope that I could help you, feel free to ask if you have any more questions.

CodedUI prints "pipe" instead of "slash"

I have a problem with using Keyboard.SendKeys in CodedUI tests during entering date. I have simple html page with textbox (input[type='text']) and I'm trying to enter date in format (M/dd/yyyy) into it by following command (I am using VB.NET):
Mouse.Click(htmledit)
Keyboard.SendKeys("^A") ' Sending keys to select all and delete hence clear content of the textbox
Keyboard.SendKeys("{DEL}")
Keyboard.SendKeys("10/10/2014")
In my machine, it works just quick and perfect.
But, today's morning I tried to run test on the another machine and I noticed that it types pipe (vertical bar) instead of each slash! So, what I got is: 10|10|2014..
I was very surprised and tried another symbols and they work just as fine as on the my machine.
By googling this problem I have nothing. Does anyone know how to fix it? And I am very curious why it happens? Keyboard.SendKeys depends on what?
Thank you.

Possible to skip text entry if value exists in a form using selenium?

I am new to Selenium and I was wondering if anyone had a solution to this issue.
I am trying to come up with a way to fill a form that has 100+ fields.
If I was using Selenium IDE or Webdriver is there a way to skip entering text in fields that already contain values?
You mean something like:
if(field.getText().equals(""))
field.sendKeys("something")
Note: this is pseudo-code!

How do I make a Selenium test for a page with a textbox whose name constantly changes?

I am trying to create a test that can enter a username and password into a login form on a page. However, the textbox name changes on every load of the page, and so the test stops each time I run it.
How can I set up Selenium IDE so that it can identify the text box across refreshes?
I am assuming that the textbox only changes part of the ID and not the entire ID each time.
To work with this I would recommend using xpath like people have put above but make it more robust in that it only find that element each time.
e.g.
//input[contains(#id,'thePartOfTheIdThatNeverChanges')]
or
//input[starts-with(#id,'thePartOfTheIdThatNeverChanges')]
or
//input[ends-with(#id,'thePartOfTheIdThatNeverChanges')]
//form1 (3) - First form element in the HTML
Pulled from here as an example This is making use of XPath. In theory you can make use of XPath to focus on parsing the structure of the XHTML, however this is fairly fragile, so it's not necessarily a wise thing to do but it should take care of your issue.
Does the location of the text box change, or just the name?
You could use a css or xpath selector to get the text box if it is in the same place.
I would recommend CSS because -
a. for the readability
b. for the ease of access (and, in your case, maintainability).
I use firebug for accessing/formulating the CSS identifier.

Selenium Automated Testing and java textboxes

Hey Ive tried looking for how to solve this for a couple hours and I keep coming up blank.
Im using Selenium IDE to try and make a few simple Automated tests (basically the test will access the site, create content and submit it, to ensure that it still works)
But there is a part of the site that is a javascript text box and i need to enter text into it.
However Selenium doesn't recognize any actions I make inside the text editing section of the box. It will recognize if I press something like BOLD or ITALICS.
When I select BOLD it returns: click | //a[#id='mce_editor_1_bold']/img |
But like i said, it wont recognize when I select the text editing part of the box.
I tried using xpath (and firebug) after some research online, but I cant seem to make that work.
Anybody have help or ideas to offer?
You can also use javascript to work with Selenium. So for example, if your rich text box has id="RichText" you can obtain the element via javascript and input your value there.
The code looks something like this:
| verifyEval | javascript{this.browserbot.getCurrentWindow().document.getElementById('RichText').value = 'Foo Bar'} ||
However, I've found that the syntax can vary for the this.browserbot portion. It will take a bit of work to get things going. You can also checkout this article from The Automated Tester which has information on what you're trying to do.
Also this question should help you out further: Selenium: How do I use javascript to clear a value from a form field?
I would recommend persevering with Firebug. Open the page that your testing and use Firebug's 'Inspect' feature to locate the text box in the HTML source. Then you should be able to find a way to locate the box using id, xpath, or css.
For example:
If it has id='textBox' you can locate it using id=textbox.
If it has class='jsTextBox' you can locate it using css=.jsTextBox
Otherwise you can use XPath - I'd recommend getting the XPath Checker extension so you can right click the text box and find out the XPath. You might want to play around with the result to make it a smarter XPath though.
Once you've found out the location you should be able to input data using the type or typeKeys commands. type changes the value, and typeKeys fires key up/down for each character - it's slower but sometimes needed depending on the application under test.
type | id=textBox | myValue
verifyValue | id=textBox | myValue
Hope this helps,
Dave.