php - how we put dynamic input such as timestamp when using selenium plugin in firefox? -
I am using selenium I am using it using the Firefox plugin. But I have a problem using it, for example, I need to copy the past command and change its property value without any 100 posts (I need them that ranges ranging from 1-100 different ranges)
I am sorry if my description is very vague. In short, this unit is about making suits where the input is dynamic, is it possible to use the selenium plug-in?
You have to export the Selenium Test case with the IDE, programming language of your choice and then tweak it .
Recycled in Selenium IDE - Consider this sample, it navigates on some forums, clicks the "new post" button, clicks the title "Title 50" and then "Post" button. :
open /viewforum.php?f=19 | | Click and watch | BTN New Post | Type | Topic | Title 50 Click and watch | BTN Post | | After that you export this test as a Java Junket (for example) and you get the following code: package com.example.tests; Import com.thoughtworks.selenium *; Import java.util.regex.Pattern; Public category poststation Selenstadt season {generates public zero set up (exceptions) {set up ("http://www.forum.com/", "* Chrome"); } Public Zero Test Taketek Post () throws exception {selenium.open ("/ viewforum.php? F = 1 9"); Selenium.click ("btnNewPost"); Selenium.waitForPageToLoad ("30000"); Selenium.type ("subject", "title 50"); Selenium.click ("btnPost"); Selenium.waitForPageToLoad ("30000"); }}
Then you need to add a loop which will create the posts with the title "Title 00" with the title "Title 001":
public zero TestCreatePost () throws an exception {for (int i = 1; i & lt; = 100; i ++) {selenium.open ("/ viewforum.php? F = 19"); Selenium.click ("btnNewPost"); Selenium.waitForPageToLoad ("30000"); Selenium.type ("subject", string format ("title% 03d", i)); Selenium.click ("btnPost"); Selenium.waitForPageToLoad ("30000"); }}
To run this test you will need selenium rc - please
Comments
Post a Comment