javascript 1 « selenium « Java Testing Q&A

Home
Java Testing Q&A
1.Development
2.FindBugs
3.HTMLUnit
4.hudson
5.junit
6.performance
7.plugin
8.profile
9.selenium
10.Tools
11.unit test
Java Testing Q&A » selenium » javascript 1 

1. Selenium Drag&Drop in testing javascript    stackoverflow.com

Need your help in such a specific situation. I use Selenium framework for testing the application, which based on "ext js" library. There are 2 trees of elements. I need to move an ...

2. How can I do automated tests on non JavaScript applications?    stackoverflow.com

I am writing controls that work nice with JavaScript, but they have to work even without it. Now testing with selenium works fine for me. But all test with disabled JavaScript ...

3. Selenium: How do I use javascript to clear a value from a form field?    stackoverflow.com

I'm using the selenium IDE and the Selenium-Fitnesse Bridge fixture and I'm trying to test that when I clear a default value out of a form field, my form displays an ...

4. reading the firebug console in javascript    stackoverflow.com

I'm looking for a way to read the most recent command that was logged to the firebug console. For example, I could have something that does

console.debug('The most current request URI is /sweatsocks');
And ...

5. Selenium adding weird characters to the end of javascript in a form field    stackoverflow.com

I'm trying to set up a field to prepopulate with a unique set of characters, so that i can automatically generate test accounts. Because of the way the system is ...

6. having javascript force a Selenium test to fail    stackoverflow.com

Is there a way for js code to force Selenium testing to fail? For (a probably bad) example, if I had the following:

return document.getElementById('foo').innerHTML == 'hello'
is there a way I could ...

7. How to fill Web Form from Flash or Javascript?    stackoverflow.com

I am looking for a solution to fill web forms from flash or javascript. The "filling" should be done non-visually. The "filling" should be initiated from user computer, because I need ...

8. How to disable Javascript when using Selenium?    stackoverflow.com

I am wondering how do I disable javascript when using selenium so I can test server side validation. I found this article but I don't know what to really do. Like I ...

9. Selenium doesn't register button press    stackoverflow.com

I have a problem running Selenium IDE over one of my AJAX pages. There is a HTML button with a javascript onclick submit that causes a new form element to ...

10. JavaScript: execute code in a specific context    stackoverflow.com

How I can execute a JavaScript function/piece of code in a specific context which it would see as a global context? This is not the same as changing this (call/apply), this ...

11. Selenium command ordering for one-after-another JavaScript prompts    stackoverflow.com

One script we have asks the user for a few values via successive JavaScript calls to window.prompt(). Selenium records this action, both the prompt texts and the values I typed ...

12. YUI Test: How to simulate more complicated user actions in JavaScript?    stackoverflow.com

I have a number of tests written with YUI Test. YUI Test capabilities when it comes to simulating users' actions are quite limited, or rather fairly low level. For instance, I ...

13. Selenium: Dynamic buttons and classes?    stackoverflow.com

So, I was trying out a test case on a website and Selenium registers the events perfectly. Now, if I have to search for a particular class and get the innerHTML ...

14. Selenium RC > how to upload file using attachFile()    stackoverflow.com

I am using Selenium RC with Junit framework. I am trying to upload a file using attachFile() method.

attachFile: (Information collected from selenium API http://release.seleniumhq.org/selenium-remote-control/1.0-beta-2/doc/java/com/thoughtworks/selenium/Selenium.html#attachFile(java.lang.String,%20java.lang.String))

void attachFile(java.lang.String fieldLocator,
     ...

15. Help on testing with Selenium    stackoverflow.com

I'm trying to make some tests on a JavaScript application and someone advised me to use Selenium. I visited its site but I cannot understand what is it and how can ...

16. Selenium: How to use stored value in a javascript comparison    stackoverflow.com

I've searched around for the answer to this and found lots of much more complicated questions, but none that gave me insight enough to figure this one out.
What I'm doing:
1- open a page ...

17. Selenium extensions: "blocking" commands    stackoverflow.com

Is it possible in selenium to write blocking commands? I want to make a "clickAndWaitForAjax" command. It will click a button and wait until a div is filled with text from the ...

18. Selenium + JavaScript + Infragistics WebDateChooser    stackoverflow.com

I am working on Selenium tests for one of our pages that has an Infragistics WebDateChooser. It took me a while to get to where I could set the date field ...

19. Running a javascript inside the head tag in Selenium RC    stackoverflow.com

I want to run a javascript snippet inside the <head> tag. Is that possible to do that in Selenium RC+Java? I understood that if I use getEval or runScript that will ...

20. What is a good way to interact with iframe elements using Selenium IDE?    stackoverflow.com

I am wanting to test a web application which uses FCKeditor in Selenium IDE. Unfortunately, FCKeditor uses iframes, which are difficult to test in Selenium IDE. ...

21. How do I get the content of a JavaScript confirmation prompt in Selenium?    stackoverflow.com

Using Selenium, how can I get the contents of a JavaScript confirmation prompt? Screenshot of the prompt: http://www.freeimagehosting.net/image.php?a296dd8a59.png

22. selenium confirm box    stackoverflow.com

I'm using selenium for auto testing . Though the reference manual says it doesnt support Javascript. Would like to know if any alternative is there for passing confirm dialog box ?? My script is ...

23. Selecting Data on JavaScript popup menu using Selenium    stackoverflow.com

I am using Selenium to test out a web site. The web site contains a date field, which when clicked, opens a popup from wherein I can choose the date. My issue ...

24. Using C# to simulate confirming a javascript popup    stackoverflow.com

So I'm trying to verify the pop-ups occur in my Selenium 2 functional tests. Right now there seems to be no built-in way for selenium 2 to handle these. Is there ...

25. Can you use the typeof operator in selenium?    stackoverflow.com

I want to do this

if (typeof(variable) == "undefined") {}
does this work in selenium?

26. How can I test DHTML with Selenium RC?    stackoverflow.com

I'm having problems testing parts of my html pages with Selenium RC. If an element is present in the page and is visible when the page is loaded then there is ...

27. Selenium IDE - unable to select value in list possibly due to 'onchange' event    stackoverflow.com

I'm having trouble running the following command to select a value in a drop down list using selenium IDE.


Command = Select Target = NumberOfAdultRecords Value = label=4
When i run the ...

28. How can I print javascript objects?    stackoverflow.com

I have an object

var object= {}
I put some data in the object and then I want to print it like this
document.write(object.term);
the term is a variable that changes depending on different situations. ...

29. Selenium 2 WebDriver - Chrome - Getting the value from a text box that is set via JavaScript    stackoverflow.com

I am using Selenium 2 (latest release from Googlecode) and I have it firing up Chrome and going to a url. When the page has loaded some javascript executes to set the ...

30. Selenium: how to find the number of childNodes of a div    stackoverflow.com

I have been banging my head on this for the better part of a day; I need to count the number of childNodes in a parent div. It basically is acting ...

31. Intercepting a Javascript function call with Selenium    stackoverflow.com

I have a test where I have to check that when a particular item is selected on a web page, the item is loaded into a flash object on the same ...

32. How to make Selenium IDE as exe?    stackoverflow.com

I downloaded Selenium IDE code.Now i want to start selenium IDE just by double clicking on it not as firefox plugin.Any Idea which helps me to start IDE as a desktop ...

33. How to execute Javascript in Selenium RC    stackoverflow.com

I can execute html script and html suite through RC. Now I would like to execute javascript through Selenium RC. I have few question related to this.

  1. Should I need to set ...

34. Detect broken lock icon (mixed secure/insecure content) from Javascript    stackoverflow.com

I'm working on making a site fully functional under HTTPS. As part of this, I'd like to ensure we never "break the lock." That is, we should never load ...

35. What are the inner workings of the Selenium waitFor mechanism?    stackoverflow.com

I am trying to customize the behavior of Selenium's click command, (via user-extentions.js), by intercepting calls to doClick(locator). Basically I need to delay click actions whenever our application's "busy indicator" is ...

36. Extending Selenium RC with new methods    stackoverflow.com

I am extending the selenium RC by using user-extension.js. It is able to call the new method function, but throwing following error message. *ERROR: Command execution failure. Please search the forum at

37. How to detect in selenium whether loading of a javascript file is loaded via ajax?    stackoverflow.com

My main page loading another page via ajax. Which has javascript file. How do i detect whether that ajax page loading is completed in selenium ? I can check for element ...

38. How do I run Selenium IDE scripts in Selenium RC?    stackoverflow.com

I am new to using the selenium testing tool and would like to know how to run selenium IDE scripts in selenium RC. I need examples and screenshots please

39. Selenium - running javascript    stackoverflow.com

i've got dumb question - how to run scripts located on tested site? I can run alert, but i dont have access to scripts written by my. I've tried runscript, geteval ...

40. how to select a text range in CKEDITOR programatically?    stackoverflow.com

Problem:

I have a CKEditor instance in my javascript:
var editor = CKEDITOR.instances["id_corpo"];
and I need to insert some text programatically, and select some text range afterwards. I already did insert text through
editor.insertHtml('<h1 id="myheader">This is ...

41. Using greasemonkey script to automate flash application    stackoverflow.com

Is there way to simulate click on a flash application using Greasemonkey script? I need to test a flash app with lot of permutations and combinations. Traditional approach of using ExternalInterface ...

42. Testing something that requires dynamic pageloads using Selenium IDE    stackoverflow.com

I'm trying to create a test for a quiz. The quiz works like this:

  1. Click and wait on the quiz link.
  2. First page has a question and radio buttons. User clicks on a ...

43. Using js execution or html parsing, which is better?    stackoverflow.com

I am a selenium aficionado and and have been dabbling in java since then. I have been executing js on selenium to parse html and do UI validation, one of the method ...

44. Using Selenium-IDE with a rich Javascript application?    stackoverflow.com

Problem

At my workplace, we're trying to find the best way to create automated-tests for an almost wholly javascript-driven intranet application. Right now we're stuck trying to find a good tradeoff between:
  • Application ...

45. javascript in select in selenium    stackoverflow.com

I'm trying set item in select using javascript (in variable I have date) Here is how I'm trying set this item

<tr>
    <td>select</td>
    <td>Recent-Year</td>
    ...

46. using JavaScript from Selenium RC by Java    stackoverflow.com

I have the following function in user-extensions.js:

Selenium.prototype.doTypeRepeated = function(locator, text) {
    // All locator-strategies are automatically handled by "findElement"
    var element = this.page().findElement(locator);

   ...

47. using JavaScript from Selenium RC by Java    stackoverflow.com

I have the following function in user-extensions.js file:Selenium.prototype.doTypeRepeated = function(locator, text) { // All locator-strategies are automatically handled by "findElement" var element = this.page().findElement(locator);

// Create ...

48. Can I Write Selenium Tests in JavaScript?    stackoverflow.com

Selenium's written in JavaScript. How do I write tests in JavaScript? I tried adding user extensions, but how do I call regular selenium commands from JavaScript? I tried calling doOpen, but ...

49. Selenium IDE: executing a test within a test    stackoverflow.com

I have written a test using selenium IDE (with flow control extensions) that iterates through elements within 2 drop-down lists (using 2 loops) and populates a data entry form according to ...

50. Selenium IDE: problems calling javascript from within a pop-up    stackoverflow.com

I am having problems testing a pop-up menu in Selenium IDE. Within the pop-up there is a button that calls a JavaScript function (that updates a list )and closes the pop-up. ...

51. Selenium Test Case Optimisation Advice    stackoverflow.com

I have written a test case that compares two arrays, removing elements that match and throwing an execption for element that don't match. It works, however the test is large and messy. ...

52. Can we add more functions using javascript in Selenium IDE?    stackoverflow.com

Hi I am newbie to selenium. I came to know that goto_sel_ide.js file which was given in one forum which helps to add the functions like gotoIf, while, label etc., Can we create ...

53. Selenium Core TestRunner HTA: storing arrays globally    stackoverflow.com

I have a test suite where, in test case A I create a populated array and store it a storeGlobal varible. Then in test case B I try to use the ...

54. How to read Firefox status bar text (Firefox WebDriver)    stackoverflow.com

Is there anyone know how can i read FireFox Browser Statusbar text. I am using FireFox WebDriver. I want it because I want to know whether my entire webpage is loaded ...

55. How to check if an input is disabled with JavaScript    stackoverflow.com

I'm building and automated test script for a webapp using selenium and I'm trying to use the waifForCondition function of the API where it will wait until a JS ...

56. How can a Selenium script be converted into the equivalent plain Javascript?    stackoverflow.com

How can a Selenium script be converted into the equivalent plain Javascript?

57. JavaScript Code behind seleniums "clickAt()" method?    stackoverflow.com

I want to do exactly that what seleniums "clickAt()" Method is doing. It is different from seleniums and the normal javascript command "click()". Because "clickAt" is working for ajax testing when the ...

58. Howto verify generated javascript code via selenium?    stackoverflow.com

in my smarty templates some javascript code is generated depending on various situations. How can I check the generated javascript code via selenium? I tried to use verifyText but this will return no ...

59. selenium with javascript    stackoverflow.com

I wrote simple js function for test,I dnt this is correct or not. This is My java script page ,file name is days.js

<script language="javascript">
Selenium.prototype.doTypeRepeated = function(ndate) { 
alert("success");
return doTypeRepeated;
}
</script>
I tried to call ...

60. passing 3 parameters into a selenium ide command    stackoverflow.com

Is it possible to pass 3 parameters into a selenium command via IDE? e.g.

Selenium.prototype.doSetList =function(array1,array2,storeAsVar)
{
   ....       
}

61. How do I have selenium execute a bookmarklet and then test the results    stackoverflow.com

I have a bookmarklet that annotates (mashes up) google searches. In my manual test, I would do a search, click on the bookmarklet and verify whether (an image, could be ...

62. Is it possible to use selenium / webdriver in C# to test file drag and drop in FireFox    stackoverflow.com

I've got a page on website that is using the awesome drag and drop file script http://aquantum-demo.appspot.com/file-upload to handle FireFox and Chrome drag and drop file uploads. Our team is ...

63. Filtering javascript XHR calls in selenium RC    stackoverflow.com

I've got a mad problem with an application I test with Selenium RC At the end of the page, several calls are made by a javascript script to an analytics webservice which ...

64. Selenium IDE > JavaScript One Liner > Inserting e-mail address with random values    stackoverflow.com

I need to enter e-mail into field which sends invite to the user. Here is my javascript code i have used for generating random values. javascript{"UserName"+ Math.floor(Math.random()*11111) + "@gmail.com";} however, after check ...

65. Is it possible to load an external javascript through Selenium RC?    stackoverflow.com

Is it possible to load an external javascript through Selenium RC? Suppose I want to enable jquery in my tests so that I could use the jquery capability for my user-extension.js. ...

66. getting the raw source from firefow with javascript    stackoverflow.com

I am writing a program to validate web pages on a remote server. It uses selenium RC to run Firefox with a battery of tests, so I can call arbitrary ...

67. selenium2 webdriver can't find the element newly created by javascript    stackoverflow.com

Click on a link triggers an operation that creates new element. However, calling driver.findElement(By.id("")) after click returns does not find it. I have tried the following code to wait for the ...

68. How to get actual JavaScript value in onclick from webbrowser control?    stackoverflow.com

I'm looking for a way to get the JavaScript code defined inside of onclick. I'm using .NET 2.0 C# Visual Studio 2005. Example:

<span id="foo" onclick+"window.location.href='someURL'>click here</span>
My goal is to get the string "window.location.href='someURL'". Scenario: A ...

69. Execute JavaScript using Selenium WebDriver in C#    stackoverflow.com

How is this achieved? Here it says the java version is:

WebDriver driver; // Assigned elsewhere
JavascriptExecutor js = (JavascriptExecutor) driver;
js.executeScript("return document.title");
But I can't find the C# code to do this. ...

70. Can I handle events when running Selenium tests?    stackoverflow.com

I am a Selenium newbie ... As a JavaScript programmer, I think I want to handle JavaScript events in my Selenium-2 tests (JUnit). I am joining a team where all of ...

71. org.openqa.selenium.firefox does not exist    stackoverflow.com

I want to run a selenium java script for firefox browser and I am getting and issue saying that "org.openqa.selenium.firefox" does not exist. I don't know what to do.

72. selenium IDE trying to get margin-bottom value    stackoverflow.com

I'm trying to get the value of the bottom margin of an element on my page. The page has a select box that allows the visitor to adjust the botttom ...

73. Selecting asynchronously loaded list element in a drop down using Selenium    stackoverflow.com

I am creating a test case which selects the drop down list returned by AJAX calls. The ajax call returns a set of <li> tags. I need to select one of it in ...

74. selenim test slow    stackoverflow.com

I have a web page which has a table. There is a script that add rows to the table, and whenever a row being added some calculation being applied. I wrote a selenium ...

75. Headless Selenium with Xvfb - JavaScript not working, but no

I'm using Selenium on a Headless Linux machine with Xvfb and Firefox and got a little strange behaviour: I have a button, which opens a inline popup with javascript and does a ...

76. selenium not reading javascript alert in c#    stackoverflow.com

i am using selenium ide for testing my .net website. i am testing login for the website by using selenium. i recorded the steps and as i am testing the code in visual ...

77. selenium not reading javascript alert in c#    stackoverflow.com

i am using selenium ide for testing my .net website. i am testing login for the website by using selenium. i recorded the steps and as i am testing the code ...

78. WebDriver executing javascript strange behaviour    stackoverflow.com

I'm using Webdriver through JBehave-Web distribution (3.3.4) to test an application and I'm facing something quite strange: I'm trying to interact with a modalPanel from Richfaces, which gave me a lot of ...

79. Wait for Javascript file to load in Selenium 2    stackoverflow.com

I'm using Selenium 2 to test the user interface of my website. I need to check that clicking a button yields some result. In 1 in every 10 or ...

80. How to retroactively add active AJAX request detection to a codebase using YUI asyncRequests    stackoverflow.com

We are using the Selenium Web Driver to test a codebase that uses the YUI 2.9 Connection object to make "asyncRequest" (ajax calls). What we would like is a way to ...

81. How to store an array returned by javascript function split in Selenium IDE    stackoverflow.com

Not a developer, new to Selenium IDE, and yes, limited to sticking with IDE only. Appreciate any and all help. Trying to grab a password from an email generated upon Password Reset ...

82. How to identify disabled radio buttons using Selenium IDE?    stackoverflow.com

While recording the script using Selenium IDE,I'm able to record Enabled "ON/"FF" radio buttons. However , when I want to check the Disabled Radio Buttons, it is not showing invidual ID ...

83. Selenium 2 - Javascript Alert triggered by Back button blocks driver.navigate().back()    stackoverflow.com

I need to handle a javascript alert which is triggered when the back button is pressed. i.e.:

  1. Go to our site
  2. Click back
  3. Javascript alert will pop up
  4. Dismiss alert I implemented a test which ...

84. Selenium: enable XPCOM access and write to a file from Javascript in Firefox    stackoverflow.com

In this question there is an example how to request XPCOM access from Javascript: How to create a file using javascript in Mozilla Firefox

 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
I was hoping to find a way ...

85. Using setTimeout in extension for Selenium IDE    stackoverflow.com

I'm trying to use JavaScript's setTimeout in an extension I've made for Selenium IDE. In short I have made the extension to take a username and password to login to a page, ...

86. Selenium C# Webdriver Dropdown Doesn't Fire Javascript    stackoverflow.com

I'm using Seleniunm to test my webpage. I have a dropdown box that I want to select an option for. This fires off some Ajax that gets some data for the relevant ...

87. Selenium - testing login doesn't enable Javascript button    stackoverflow.com

I'm new to Selenium IDE. I have login form with following button functionality:

function init()
{   //attach the login validation to the password on change event
getElem("Password").onkeyup = handleLoginButtonValidation;
}

function handleLoginButtonValidation()
{   ...

88. Selenium - Trying to invoke an href when the href="javascript"    stackoverflow.com

Running Sel 2.4, Firefox driver, linux ( -new to sel, new to java as well!!) I've got the following chunk of html I'm trying figure out how to invoke the submit anchor. I verify ...

89. Selenium - Log messages to selenium RC log through Javascript - Possible?    stackoverflow.com

I am trying to log messages to Selenium RC's log through Javascript. For example

seleniumRc.log('Statement');
Is it possible? Thanks! DashK

90. How to count active javascript timeouts?    stackoverflow.com

I am using Selenium to test a web app that uses Dojo, and it uses java script to display certain elements. I want to wait until all of the elements are ...

91. Ext JS concealing text field contents from HTML and Selenium    stackoverflow.com

I've been writing test automation (in Selenium2 Java, Firefox 3.6) of an application that uses a lot of ExtJS. I have been able to work around the mighty morphing element ...

92. How to call JS file through selenium    stackoverflow.com

Is there a way I run my JS file through selenium Web driver. I'm given to disable and enable JS script in my firefox browser when my tests are running. Is it ...

93. Store absolute URL for selenium test using javascript    stackoverflow.com

I have a html file which stores which suppose to store the absoluteUrl whose content is this :

<html>
<head><title>Root URL variable</title></head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">Root URL variable</td></tr>
</thead><tbody>

<tr>
    <td>store</td>
 ...

94. Selenium: How to wait for a element's text to change    stackoverflow.com

I have an element whose status (in text form) changes depending on a contextmenu associated with it.
Here is the element:

td id="A" name="status"> StatusStart ...

95. JavaScript Processing In Selenium And HtmlUnit    stackoverflow.com

I'm planning to use HtmlUnit in my Java application to test drive some website but I heard it may not be able to handle complex JavaScript, what is your experience with ...

96. Load an external js file containing useful test functions in selenium    stackoverflow.com

The runScript command in selenium is really useful, and I'm using it to total values in a table and then store the value like this

<tr>
    <td>runScript</td>
   ...

97. How to use getEval in selenium C#.net?    stackoverflow.com

can i use like this selenium.getEval("var val= document.getElementById('name').value;")

98. How to use JavaScript in Selenium C#.net?    stackoverflow.com

I export the test case as a cs file from Selenium. I want to get all objects under the window during run time, so I selected JavaScript for that. How to ...

99. How to define ActiveXObject in selenium.geEval method?    stackoverflow.com

i'm using selenium rc for automation i used selenium.GetEval(" var fso = new ActiveXObject('Scripting.FileSystemObject')"); but it shows activex not defined error during run time..

100. Capturing javascript updates with selenium    stackoverflow.com

I'd like to extract a stream of data from a live webpage updated continuously by a javascript code that doesn't reload the page itself. How do I do this with selenium ...

java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.