selenium-ide

Selenium WebDriver with Java: Can't accept alert

有些话、适合烂在心里 提交于 2019-11-28 02:00:21
问题 When recording in selenium IDE I can click the "OK" button in a popup, and expected to be able to click it using driver.findElement(By.linkText("OK")).click(); but this was not the case. Similarly this doesn't work. driver.switchTo().alert().accept(); Selenium throws a NoAlertPresent exception. If what's popping up is not an alert, then what is it? And how do I click yes! 回答1: in such case I'd prefer to check(verify) the alert presence on the page and then if is present - accept it. It be

Load an external js file containing useful test functions in selenium

江枫思渺然 提交于 2019-11-28 00:30:42
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> <td>var cumulative = 0.0; $('table.quote-review-group-component').eq(0).find('tr').each( function( i,el ){var singleStackTotal = $(el).find('td').eq(4).html();if( singleStackTotal ){cumulative += parseFloat( singleStackTotal.substring(1) );} }); cumulative = cumulative.toFixed(2)</td> <td></td> </tr> <tr> <td>storeEval</td> <td>selenium.browserbot.getUserWindow().cumulative</td> <td>cumulative</td> </tr> <tr> <td>echo</td> <td>${cumulative}<

Using if / else in selenium ide

余生长醉 提交于 2019-11-27 22:54:39
I have a checkbox that I'm trying to click in Selenium IDE - but only if it's not already active. I'm using Selenium IDE to create my tests, and htmlsuite to run them - anyone know how I can use an "if" in those? Petr Janeček You'll have to download the Flow Control plugin for Selenium IDE from the official page (aaaall the way down). The most useful link I found is this one, because it has a complete example in it: http://selenium.10932.n7.nabble.com/if-else-statement-td4370.html Anyway, there's also a documentation and author's blogpost explaining something more. The only alternative I know

Using if / else in selenium ide

北慕城南 提交于 2019-11-27 19:11:09
问题 I have a checkbox that I'm trying to click in Selenium IDE - but only if it's not already active. I'm using Selenium IDE to create my tests, and htmlsuite to run them - anyone know how I can use an "if" in those? 回答1: You'll have to download the Flow Control plugin for Selenium IDE from the official page (aaaall the way down). The most useful link I found is this one, because it has a complete example in it: http://selenium.10932.n7.nabble.com/if-else-statement-td4370.html Anyway, there's

Selenium IDE:Opening in new tab and shift focus to new tab not working

别说谁变了你拦得住时间么 提交于 2019-11-27 18:16:40
问题 i have stuck in one point in selenium ide the scenario is like this Login----- go to dashboard page--------- mouse over any menu on the top navigational bar---- on mouseover sub menu will appear as drop down-- now click any link from the drop down -- after clicking link will open in new tab now from that point on-wards we have to shift our focus to that new tab because rest of the testing will be done on that new tab. The code i have written is given below <tr> <td>open</td> <td>/magma/dev/<

How to get Selenium to wait for a transition page to redirect before running an assertion

隐身守侯 提交于 2019-11-27 17:18:13
问题 I have a fairly standard situation: Click a button, it loads a transition page with a progress bar or something, and then that page redirects to the next page, which takes a while to load. I want to run assertions on the final page, not the transition page. How do I tell Selenium IDE to wait till the final page loads before performing the assertions? Thank you. 回答1: A simple approach would be wait for some "particular" text on that final page, see "waitForText" command for further info on it

How to loop tests in Selenium IDE?

孤街浪徒 提交于 2019-11-27 12:56:40
问题 I've been testing in Selenium IDE. It's pretty easy to use, and I have created some test cases with it. I've been searching Google, trying to find a way to repeat my tests automatically. I've seen a solution with gotolabel, while loops, etc. But I couldn't make any of them works. Can someone give me a tip on how to loop my test n times, or loop forever. I appreciate any help. 回答1: Do this: Download this js file: https://github.com/darrenderidder/sideflow/blob/master/sideflow.js Launch

How to convert commands recorded in selenium IDE to Java?

安稳与你 提交于 2019-11-27 12:06:28
Is there any application or simple way to convert all the commands recorded by Selenium IDE to Java (Selenium WebDriver) ? It would be a lot more easier and would save a lot of time. Any suggestions will be appreciated. Thanks! Pavel Janicek In my Selenium IDE version 2.4.0 it is easy as pie: Record testcase in Selenium IDE Click File - Export Test Case As - Java / JUnit4 / WebDriver Save File as .java And here you go! Your testcase is converted to WebDriver ;) Update: Starting from SeleniumIDE 3.x unfortunately both functions mentioned in previous answers "Export" and "Options->Format" were

click command in selenium webdriver does not work

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-27 11:30:16
问题 I have just recently done an export of my selenium IDE code to selenium web driver. I have found that a lot of the commands that worked in IDE either fail to work or selenium web driver claims to not support at all. So far I've been tackling these issues one at a time which is less than ideal... Currently I'm working on finding out why clicking on a button does not work with web driver while it had previously worked in selenium IDE. My browser is FF 13 and my OS is Ubuntu. Code Snippet

selenium webdriver upload file

南笙酒味 提交于 2019-11-27 09:16:16
I am new to selenium, I have a script that uploads a file to a server. In the ide version sort of speak it uploads the file, but when I export test case as python 2 /unittest / webdriver it doesn't upload it.. It doesn't give me any errors, just doesn't upload it... The python script is: driver.find_element_by_id("start-upload-button-single").click() driver.find_element_by_css_selector("input[type=\"file\"]").clear() driver.find_element_by_css_selector("input[type=\"file\"]").send_keys("C:\\\\Documents and Settings\\\\pcname\\\\Desktop\\\\ffdlt\\\\test.jpeg") I searched for solutions but I