selenium

Take screenshot with Selenium: WaitForPageToLoad does not wait long enough

I'm trying to get screenshots from a web page with multiple browsers. Just experimenting with Selenium RC, I wrote code like this: var sel = new DefaultSelenium(server, 4444, target, url); sel.Start(); sel.Open(url); sel.WaitForPageToLoad("30000"); var imageString = sel.CaptureScreenshotToString(); This basically works, but in most ca...

Iterate through all form fields with selenium in ruby

I am trying to validate that my form fields all have an associated label using Selenium, but I am having problems grabbing all of the form fields on a page. get_all_fields only gets textfields; I have no way to also grab the passwords, radios, checkboxes, etc. I was trying something like this: num_fields = Integer(selenium.get_xpath_c...

Saving a file with WWW::Selenium

Im trying to download a file with perl's WWW::Selenium. I get a popup box asking me if I want to save/open the file. I want to manipulate it and say 'save' at some given location. Im not sure how this can be done. Please help. P.S: I could not use WWW::Mechanize for this page and I have to use Selenium Thanks a lot! ...

selenium how to verify character font?

the problem as the title. ...

Why do Selenium Python tests look so weird?

I've used the Selenium IDE to generate some test code for my application. The generated Python code for an assertion looks like this. try: self.failUnless(sel.is_text_present("Path")) except AssertionError, e: self.verificationErrors.append(str(e)) Instead of failing fast, the error is added to a list, and the script continues...

How to use JQuery in Selenium?

Hi, I would like to use Selenium to click on the tab of a web where the tab was created dynamically using JQuery. There is one problem, since it was created dynamically and the tab got no ID tied to it (only class-ID provided), so I am running out of clue to click on it using Selenium. After googling for 2 weeks, I found out that it c...

How can I control in which of my desktops the browser called by selenium remote server will pop up?

I am running tests from phpunit using selenium. Since the tests take a couple of minutes proceed, I would like to switch to another desktop and do some tasks while the tests are running in the background. However, since every test calls a new browser via selenium remote server, and a new test management window and a application window ...

Does selenium RC runs c# tests using java -jar option ?

Is there any option available to run c#/.NET tests directly using selenium server like following option for html based tests? ( java -jar selenium-server.jar C# based tests/suites) -htmlSuite : Run a single HTML Selenese (Selenium Core) suite and then exit immediately, using the specified browser (e.g. "*firefox") on the s...

Selenium, php, phpUnit, 404 error calls testComplete() rather than continue, how do I stop this?

Selenium, php, phpUnit, 404 error calls testComplete() rather than continue, how do I stop this? I am using selenium server and phpUnit to run php based tests. My tests are simple, test the page is there, if it loads, has no errors on page and then move on. I have a missing page and rather than say, yep its not there and more on I get: ...

isTextPresent fails all the time in Selenium test. Not sure if I am doing anything wrong

I have this little piece of code that just checks for a particular text at a location on the page and if that text is found, it will check for something else..Here is the snippet: if (!selenium.isTextPresent("//div[contains(concat('',@class,''),'contentLg')]/h2")) { System.out.println("The About Us text is not pr...

How to click a javascripted' radio button and fetch next page using Python (urllib2)? [WebScrape, selenium]

I am struggling with this. I have a fully tested python script. I have to make a small change wherein I have to first click on a radio button which in turn automatically executes a javascript function forwarding the page to a search form. My working platform : Linux Language : Python Radio button code : <input type="radio" language...

Unable to auomate SWF component using Selenium

I am automating test for a website using selenium, but selenium is not able to identify SWF components. Please let me know if there's a way to automate SWF components with Selenium & perl. Here's the test link to check proof of concept: http://demo.swfupload.org/v220/simpledemo/index.php ...

Does event delegation work with webdriver in firefox?

I'm using webdriver to test a site. Event delegation is being used across a number of links to load data via ajax: jQuery("body").delegate("a", "click", function adjustHref(event) { // callback }); In the test I...

Selenium 2 cant find element ID unless I go directly to the .aspx file

So I'm trying to make the conversion to Selenium 2, but I seem to have an issue were if I go to http://website.com, Selenium cant find the elements of my aspx form. I need to have Selenium go directly to http://website.com/form.aspx. This isnt horrible because I can make sure the forms work, but ideally I would like it to complete everyt...

Validate data driven testing

Hi I got the code for getting the data from excel and den using in selenium. My problem is that when i give invalid data in the text boxes those are also getting accepted!! But when i checked by entering those invalid data in the same text box its not accepting ...

Cucumber, Capybara validating HTML and testing JavaScript together fails

I've recently added html validation to my cucumber features. I'm using the gem be_valid_asset which works really well until Cucumber hits a @javascript flagged feature. This kicks in culerity (I've tried selenium for this as well) and then the html validation fails. The reason the validation fails is that both culerity and selenium ap...

How to save and restore all cookies with Selenium RC?

I'm running complex tests that create many cookies for different sections of my web site. Occasionally I have to restart the browser in the middle a long test and since the Selenium server doesn't modify the base Firefox profile, the cookies evaporate. Is there any way I can save all of the cookies to a Python variable before terminati...

How to verify the ascending/descending order in Selenium

Need to verify whether the Link Most Viewed and Highly rated videos sorting the list correctly or not by order. ...

Selenium SeleniumTestCase .checkForVerificationErrors method : output status before it fails

Hi I am testing a table on a webpage where i need to verify all values in table. For this i have written a for loop something like this for (row) { for (column) { SeleniumTestCase.verifyTrue( "expected".equals("obtained")); } SeleniumTestCase.checkForVerificationErrors(); } Here in the fifth line i am checking was th...

How to iterate through DOM elements that match a css class using xpath?

I'm processing an HTML page with a variable number of p elements with a css class "myclass", using Python + Selenium RC. When I try to select each node with this xpath: //p[@class='myclass'][n] (with n a natural number) I get only the first p element with this css class for every n, unlike the situation if I iterate through selectin...