????λ?????????? >> ??????????
Selenium???????????????
???????????? ???????[ 2014/7/30 12:01:03 ] ??????????????? ???????
??????????XPATH?????????ο?W3C???????????
????Using JavaScript
???????????????????????????????????jqury?????
????element=driver.execute_script("return $('.cheese')[0]")
????labels=driver.find_elements_by_tag_name("label")inputs=driver.execute_script("var labels = arguments[0]?? inputs = []; for (var i=0; i < labels.length; i++){"+"inputs.push(document.getElementById(labels[i].getAttribute('for'))); } return inputs;"??labels)
????User Input - Filling In Forms
????select=driver.find_element_by_tag_name("select")allOptions=select.find_elements_by_tag_name("option")foroptioninallOptions:print"Value is: "+option.get_attribute("value")option.click()
??????Щ??????????????????????????
????# available since 2.12fromselenium.webdriver.support.uiimportSelectselect=Select(driver.find_element_by_tag_name("select"))select.deselect_all()select.select_by_visible_text("Edam")
?????????Щform????????????
????driver.find_element_by_id("submit").click()
????element.submit()
????Moving Between Windows and Frames
????<a href="somewhere.html"target="windowName">Click here to open a new window</a>
????driver.switch_to_window("windowName")
????driver.switch_to_frame("frameName")
????driver.switch_to_frame("frameName.0.child")
?????л??Щ????????????????
????Popup Dialogs
???????????alerts?? confirms?? and prompts??
????alert=driver.switch_to_alert()
??????????????????????????
????Cookies
????# Go to the correct domaindriver.get("http://www.example.com")# Now set the cookie. Here's one for the entire domain# the cookie name here is 'key' and its value is 'value'driver.add_cookie({'name':'key'??'value':'value'??'path':'/'})# additional keys that can be passed in are:# 'domain' -> String??# 'secure' -> Boolean??# 'expiry' -> Milliseconds since the Epoch it should expire.# And now output all the available cookies for the current URLforcookieindriver.get_cookies():print"%s -> %s"%(cookie['name']??cookie['value'])# You can delete cookies in 2 ways# By namedriver.delete_cookie("CookieName")# Or all of themdriver.delete_all_cookies()
????Changing the User Agent
????profile=webdriver.FirefoxProfile()profile.set_preference("general.useragent.override"??"some UA string")driver=webdriver.Firefox(profile)
????Drag And Drop
fromselenium.webdriver.common.action_chainsimportActionChainselement=driver.find_element_by_name("source")target=driver.find_element_by_name("target")ActionChains(driver).drag_and_drop(element??target).perform()
???????????????????????漰???????????????????SPASVOС??(021-61079698-8054)?????????????????????????
??????
????????????????AutoRunner??Selenium??????????????????????????????????????????е?????????????????ν??????????????????????????????????????QTP??AR???????????????????????????е?????????????????????????????????У???????5?????????????????????ν?????????????PR???????????????????????????????AutoRunner?ж??????????????????????AutoRunner???????????????????app????????????MR????????????庯??????????????AR??????????????壿??ν??д???????????????????????????????????Щ?????????????????????Щ?????????????????????????????ο???????????????????PR???????????????????????????????ù??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11????????
?????????App Bug???????????????????????Jmeter?????????QC??????APP????????????????app?????е????????jenkins+testng+ant+webdriver??????????????JMeter????HTTP???????Selenium 2.0 WebDriver ??????