Unable to pass the value using sendkeys in Selenium webdriver - selenium

I am unable to send any value to my application using webdriver. I'm able to click on the element. But SendKeys is not working, execution stops once I click on a Textbox.
driver.findElement(By.xpath("//table[#id='atgf']/tbody/tr[2]/td[3]")).click();
driver.findElement(By.xpath("//table[#id='atgf']/tbody/tr[2]/td[3]")).sendkeys("abc");

Try using the following way,
driver.findElement(By.xpath("...")).sendkeys(new String[]{"abc"});

Try using a Thread.sleep(time in ms) before entering the value in the text field. Sometimes that may be the issue.

Java compiler is set to 1.5 version change it to 1.6.
This is a very common problem with the Java compiler.
All you need to do is just set the Java compiler 1.6 from 1.5.
To change the Java compiler version, complete the following steps:
In the Project Explorer view of the Java EE perspective, right-click
the project and then select Properties.
Select the Project Facets page in the in the Properties window. This page lists the facets in the project and their versions.
Click Modify Project.
Double click the version number next to theJava facet to select a different level of Java compiler.
Click Finish to close the Modify Faceted Project window and then click OK.

Related

Juno IDE for Julia, how to interact?

One way to comfortably use an IDE in an interactive language is to interact via the IDE in a command line environment. I am wondering if that is a possibility in Juno. In other words, is there a command line environment as in Matlab, to call functions, give initial values, and run expressions. If so what is the way to access it?
Note: There is a console window in Juno, but I can't find a way to insert my commands inside that.
Note: The question and this answer apply to the version of Juno that was based on LightTable. The current version is based on Atom and has an interactive console.
You can't enter commands into the console in Juno--that's for displaying output. Commands can be submitted from within the editor by setting your cursor in the line to submit and pressing Ctrl+Enter or Shift+Enter. The value will then be displayed in a small popup next to the line and the output will be printed to the console if you have the console visible.
Note that the inability to use the console as you desire is by design. See here for information about the console from the Juno docs.

Pop-up menu is not fully visible in IntelliJ IDEA

I am just evaluating IntelliJ IDEA. Installed it with default procedures.
I created a simple Spring project and when I right click on the project, not able to see the the bottom part of the pop up menu. The issue is because of my laptop screen's height is less and could not fit the entire set of pop-up menu items.
In eclipse there is a drop down arrow, so that I can scroll to the menu items, which do not fit in the screen. How can I get the similar eclipse functionality in IntelliJ?
Well, you are only missing one useful feature (Genereate Java code from wsdl). I would ignore it unless you need to generate such code.
If you want to run this generation you can do this with Ctrl + Shift + A (and start typing feature name)
//btw, it is better to make code generation in maven anyway

IntelliJ 12, module-depenencies all red, no path.

I have a real problem with making Play2.0 work with IntelliJ EAP version (120.152).
I create an empty project without module in IntelliJ
I create a new application using the play command, and using play idea at the end
I then add this module from IntelliJ, using "Import from existing module"
Now, I have two folders too chose from when importing the module.
1. .idea
2. .idea_modules
After seeing some different ways on the internet,
I chose .idea_modules -> moduleName.iml
(I have tried all the others just to check)
Here is what bothers me the most
Anyone had anything similar? I am not sure why this is, every other screenshot I have seen from this, have a path behind the red text (making it work!), which I do not.
Any suggestions what I can do from here to hopefully make this work?
My Scala facet looks like this in the IDE, but I have not seen any Play documentation that goes into modifying the facet, so I just leaved it as is
In IntelliJ 12 - the same as in IntelliJ 11 you can open the Play's project since version 2.0.2, just by using option 'Open project' in the start window view.
You don't need to create blank project first in IDE.
play new test-leda + all required steps by play console
cd test-leda
play idea + wait for bash prompt which indicates finalization
Open Leda and choose Open project
Find the folder test-leda and just click Choose
That's all

Convert JUnit test case to Selenium IDE html file?

I have learnt how to export Selenium IDE html file to JUnit.
But if I make a change to the JUnit test - is there a way I can convert the Junit test to Selenium IDE html file so that even if I run the test from IDE the new change is recorded?
What is the best practice for such scenarios?
Note: (2nd user#Manii88), I am also facing the same issue...THough it might be an old question, it is still not solved yet...I find this question compelling because, say for example, I am in middle of some test, which i have exported from selenium ide and modified in Selenium Webdriver, eclipse, to check the viability of test cases and handling of popups...then, i want to continue my test case in ide...till the step completed, i want to proceed quickly and then, the next step, i will continue recording...
Hope this makes the scenario clear...Any answers???
Thanks!
Though it's not always possible, you may try the below steps to achieve it to some extent:
Install the latest Selenium IDE (or at least >= 1.6)
Open Selenium IDE
Options Menu > Format > JUnit 4 (Webdriver backed) [or use the same option here which was used while exporting html to JUnit]
Dismiss the warning dialog
Go to the Source tab, and paste your JUnit code
Change the format again back to HTML by selecting Options > Format > HTML
Dismiss the warning dialog
Switch (back) to Table tab to see your latest changes

How do I use Selenium IDE on Firefox to test JavaScript generated codes?

I am trying to test a website which contains alot of javascript.
Javascript does alot of opening new dialog to let user choose "yes" or "no".
It also has a function to upon right clicking, it opens up a right click menu which contains many functions such as zip, delete etc.
In Selenium, I can use the Selenium IDE to login, click, and others, but I don't know how to test those functions.
I've read there are codes I can write such as in Java to run the test, but I'm hoping to make it work by using the simple Selenium IDE if possible. If not, then can someone post a simple testing code which works to run java scripts? Such as click button -> javascript menu pops up -> click ok on the pop up.
Thank you very much.
Right context menus can be a little tricky. I'd suggest making custom commands for the right click context menu. Add the code from this article to your custom user-extensions.js file.
http://old.nabble.com/How-to-recognise-right-click-of-the-mouse-in-IDE-td14913052.html
The parameters for these functions in these commands become the expected arguments of your Selenium IDE commands. If you really want to make it simple, you can just call your javascript functions in these custom user-extension commands. :-) That might be a bit lazy and isn't truely testing what your right click is doing, but it would work.
Option #1 - if using IDE:
Specify the user-extensions.js file under Selenium IDE > Options (menu) > Options (menu option) > General Tab, then browse to your file under "Selenium Core Extensions".
Option #2 - if using Selenium RC Server:
If you're not using the IDE and using Selenium RC server with a client driver (like JUnit for example), you must specify the path of the *.js file with the -userExtensions parameter when you start the Selenium RC Server on the command line. But you said you just wanted to use the IDE, so I'd ignore this. It takes quite a bit of other setup to use the Selenium RC server.
java -jar selenium-server.jar -userExtensions user-extensions.js
=======================
I've never done this before, so I made the following custom command (JavaScript function) in my custom user-extensions.js file, and it worked well for me. I had to exit and restart the IDE before it found it. For some reason, you type everything after the "do" in the "Command" field in the IDE. It looks like it also added a "customAlertAndWait" to the IDE as well.
Code in user-extensions.js file:
Selenium.prototype.doCustomAlert = function(sTarget, sValue) {
alert('Target: ' + sTarget + ' ... Value: ' + sValue);
};
Selenium IDE command details:
Command: customAlert
Target: custom alert target
Value: custom alert value
The selenium IDE has a lot of tools to verify that specific elements are present and that the value is correct.
To set something up, you would create a test case, and start to record it. When you get to a page where you have to verify that something exists, right click on that element, and you will see a lot of Selenium commands tagged at the bottom of the click menu, such as "VerifyTextPresent" or "verifyValue" or "verifyElementPresent" When you select those commands, they will appear in your test case, and will fail if the verification fails.