How to use wait_until_element_is_visible method in robotframework-appiumlibrary

Best Python code snippet using robotframework-appiumlibrary_python

vendorBidKeywords.py

Source:vendorBidKeywords.py Github

copy

Full Screen

...31 sl = BuiltIn().get_library_instance('SeleniumLibrary')3233 Wait_For_Page_To_Load(60)3435 sl.wait_until_element_is_visible(btn_VendorBidMgmnt,'3mins')3637 sl.click_element(btn_VendorBidMgmnt)3839 Wait_For_Page_To_Load(30)4041 Wait_For_Page_To_Load(60)4243 sl.wait_until_element_is_visible(elem_ScenarioStatus,60)4445 BuiltIn().set_suite_variable('${var_ScenarioStatus}',sl.get_text(elem_ScenarioStatus)) 4647 BuiltIn().log('Scenario Status is '+BuiltIn().get_variable_value('${var_ScenarioStatus}'))4849 5051 sl.wait_until_element_is_visible(elem_ApprovalStatus,60)5253 Wait_For_Page_To_Load(30)5455 if sl.get_text(elem_ApprovalStatus)!='Vendor Bid Required':5657 BuiltIn().log('Vendor Bid Not Required')5859 else:6061 BuiltIn().log('Vendor Bid Required')6263 6465 sl.wait_until_element_is_visible(cbx_SelectAll,60)6667 sl.click_element(cbx_SelectAll)6869 Wait_For_Page_To_Load(30)7071 sl.wait_until_element_is_visible(btn_SubmitBid,'3 mins')7273 sl.click_element(btn_SubmitBid)7475 Wait_For_Page_To_Load(60)7677 sl.wait_until_element_is_visible(elem_ApprovalStatus,60)7879 Wait_For_Page_To_Load(60)8081 8283 while(sl.get_text(elem_ApprovalStatus)!='Vendor Bid Open'):8485 if (sl.wait_until_element_is_enabled(btn_Refresh,'2 mins')):8687 Wait_For_Page_To_Load(60)8889 sl.click_element(btn_Refresh)9091 Wait_For_Page_To_Load(60)9293 else:9495 Wait_For_Page_To_Load(60)9697 if(sl.get_text(elem_ApprovalStatus)=='Vendor Bid Open'):9899 BuiltIn().log('Vendor Bid Open')100101 break102103 104105 BuiltIn().log('Approval status check done')106107 Wait_For_Page_To_Load(60) 108109 BuiltIn().set_suite_variable('${var_GuruId}',sl.get_text(lbl_GuruId)) 110111 BuiltIn().log('Guru ID is '+BuiltIn().get_variable_value('${var_GuruId}'))112113 Wait_For_Page_To_Load(60)114115 116117@keyword118119def Launch_ROC(url):120121 sl = BuiltIn().get_library_instance('SeleniumLibrary')122123 open_browser_maximized('chrome','a')124125 sl.go_to(url)126127 sl.execute_javascript("document.body.style.zoom='100%'")128129 # handles= sl.get_window_handles()130131 # open_new_tab()132133 sl.go_to(url)134135 sl.set_selenium_implicit_wait(20)136137 sl.set_browser_implicit_wait(10)138139 140141@keyword142143def Login_to_ROC(username,password):144145 sl = BuiltIn().get_library_instance('SeleniumLibrary')146147 sl.wait_until_element_is_visible(elem_Login)148149 Wait_For_Page_To_Load(30)150151 sl.wait_until_element_is_visible(txt_RocUsername)152153 sl.input_text(txt_RocUsername,username)154155 BuiltIn().sleep(3)156157 sl.wait_until_element_is_visible(txt_RocPassword)158159 sl.input_password(txt_RocPassword,password)160161 Wait_For_Page_To_Load(60)162163 click_element_using_javascript(btn_RocSubmit)164165 Wait_For_Page_To_Load(60)166167 168169@keyword170171def Search_GuruID(var_GuruId):172173 sl = BuiltIn().get_library_instance('SeleniumLibrary')174175 BuiltIn().log('Guru ID is '+var_GuruId)176177 178179 click_element_using_javascript(btn_filterRequests)180181 sl.wait_until_element_is_visible(advancedSearchTab)182183 Wait_For_Page_To_Load(60)184185 186187 # pip install pyautogui188189 Wait_For_Page_To_Load(60)190191 sl.wait_until_element_is_visible(statusDropdown,'3 mins')192193 sl.click_element(statusDropdown)194195 Wait_For_Page_To_Load(30)196197 sl.scroll_element_into_view(cbx_OpenStatus)198199 click_element_using_javascript(cbx_OpenStatus)200201 Wait_For_Page_To_Load(30)202203 204205 sl.input_text(txt_rocIdField,var_GuruId)206207 click_element_using_javascript(btn_search)208209 Wait_For_Page_To_Load(30)210211 #rocID = get_elements(txt_RocIdColumn)212213 #count = len(rocID)214215 216217 click_element_using_javascript(btn_requestsDetails)218219 Wait_For_Page_To_Load(30)220221 222223 #pyautogui.press(['ctrl', 'tab'])224225 sl.switch_window('NEW')226227 Wait_For_Page_To_Load(60)228229 #sl.wait_until_element_is_visible(btn_AssignToMe,60)#uncomment230231 #click_element_using_javascript(btn_AssignToMe)#uncomment232233 Wait_For_Page_To_Load(60)234235 236237 errcount = 0238239 i = 0240241 if(visibility_of_element_located(btn_yes)):242243 i = i+1244245 click_element_using_javascript(btn_yes)246247 sl.set_browser_implicit_wait(10)248249 logger.info("i = "+str(i))250251 else:252253 errcount=1254255 logger.info("Continue.." +str(errcount))256257 258259 Wait_For_Page_To_Load(60) 260261 262263 sl.set_selenium_implicit_wait(20)264265 sl.set_browser_implicit_wait(10)266267 sl.scroll_element_into_view(elem_Clli)268269 #sl.set_selenium_implicit_wait(20)270271 272273 BuiltIn().set_suite_variable('${var_clli}',sl.get_text(elem_Clli)) 274275 BuiltIn().log('CLLI is '+BuiltIn().get_variable_value('${var_clli}'))276277 Wait_For_Page_To_Load(60)278279 sl.scroll_element_into_view(btn_createBid)280281 282283 sl.set_selenium_implicit_wait(20)284285 286287 count = 0288289 sl.wait_until_element_is_enabled(btn_createBid,30)290291 while(count==0):292293 click_element_using_javascript(btn_createBid)294295 sl.set_selenium_implicit_wait(20)296297 if(invisibility_of_element(btn_createBid)):298299 count = 1300301 else:302303 logger.info('continue while loop')304305 logger.info('end of while loop')306307 308309 errcount = 0310311 i = 0312313 # while((errcount==0)&(visibility_of_element_located(popupBox)==True)):314315 if(visibility_of_element_located(btn_yes)):316317 i = i+1318319 click_element_using_javascript(btn_yes)320321 sl.set_browser_implicit_wait(10)322323 logger.info("i = "+str(i))324325 else:326327 errcount=1328329 logger.info("Continue.." +str(errcount))330331 332333@keyword334335def Create_New_Bid(vendorName,SiteAddress,mrc36,nrc36):336337 sl = BuiltIn().get_library_instance('SeleniumLibrary')338339 Wait_For_Page_To_Load(60)340341 BuiltIn().sleep(3)342343 click_element_using_javascript(tbx_VendorName)344345 Wait_For_Page_To_Load(60)346347 BuiltIn().sleep(3)348349 # drop=Select(driver.find_element_by_id('vendorId'))350351 # drop.select_by_visible_text("LUMEN ")352353 # click_element_using_javascript(tbx_VendorName)354355 # Wait_For_Page_To_Load(60)356357 # BuiltIn().sleep(3)358359 # click_element_using_javascript(tbx_Vendor_Lumen)360361 # Wait_For_Page_To_Load(60)362363 # BuiltIn().sleep(3) 364365 # click_element_using_javascript(tbx_Vendor_Lumen)366367 368369 370371 sl.select_from_list_by_value(tbx_VendorName,"1243") #lumen372373 BuiltIn().sleep(3)374375 376377 sl.click_element(dbx_AccessPop)378379 Wait_For_Page_To_Load(60)380381 sl.input_text(dbx_AccessPop,SiteAddress)382383 BuiltIn().sleep(3)384385 386387 click_element_using_javascript(dbx_currency)388389 Wait_For_Page_To_Load(60)390391 BuiltIn().sleep(3)392393 click_element_using_javascript(dbx_currency_value)394395 Wait_For_Page_To_Load(60)396397 BuiltIn().sleep(3) 398399 400401 sl.wait_until_element_is_visible(MRC_field36)402403 sl.input_text(MRC_field36,mrc36)404405 Wait_For_Page_To_Load(60)406407 sl.wait_until_element_is_visible(NRC_field36)408409 sl.input_text(NRC_field36,nrc36)410411 Wait_For_Page_To_Load(60)412413 414415 sl.click_element(dbx_VendorNote)416417 Wait_For_Page_To_Load(60)418419 sl.click_element(VendorNote_value)420421 BuiltIn().sleep(3)422423 424425 click_element_using_javascript(btn_AddNote)426427 Wait_For_Page_To_Load(60)428429 430431 count = 0432433 while(count==0):434435 click_element_using_javascript(btn_SaveBid)436437 sl.set_selenium_implicit_wait(20)438439 if(invisibility_of_element(btn_SaveBid)):440441 count = 1442443 else:444445 logger.info('continue while loop')446447 logger.info('end of while loop')448449 Wait_For_Page_To_Load(60)450451 452453 454455@keyword456457def Recommend_and_Save_Bid():458459 sl = BuiltIn().get_library_instance('SeleniumLibrary')460461 sl.scroll_element_into_view(tgl_RecommendedBid)462463 click_element_using_javascript(tgl_RecommendedBid)464465 sl.set_browser_implicit_wait(10)466467 468469 i = 0470471 locator = "xpath://span[text()='$TaskName']"472473 locator = locator.replace('$TaskName',Task_Name)474475 sl.wait_until_element_is_visible(locator,'2 mins')476477 while(visibility_of_element_located(tgl_RecommendedBid_Success)==False):478479 click_element_using_javascript(tgl_RecommendedBid)480481 sl.set_browser_implicit_wait(20)482483 i = i+1484485 logger.info("value of i:" +str(i))486487 sl.set_browser_implicit_wait(10)488489 ...

Full Screen

Full Screen

TwitterLibrary.py

Source:TwitterLibrary.py Github

copy

Full Screen

...16 def get_locator(self, name):17 return self.builtIn.get_variable_value('${' + name + '}')18 @keyword(name='Wait Until Main Page Is Opened')19 def wait_until_main_page_is_shown(self):20 self.selenium.wait_until_element_is_visible("//*[contains(@class,'DashboardProfileCard')]//*[text()='%s']" % BuiltIn().get_variable_value('${userName}'))21 @keyword(name='Wait Until Edit Profile Page Is Opened')22 def wait_until_edit_profile_page_is_opened(self):23 closeModalButton = self.get_locator('closePersonalInfoEditModalButton')24 self.selenium.wait_until_page_contains_element(closeModalButton, 3)25 addAvaterButton = self.get_locator('addAvaterButton')26 self.selenium.wait_until_page_contains_element(addAvaterButton, 3)27 @keyword(name='Wait Until Element Is Shown On Page')28 def wait_until_element_is_shown_on_page(self, locator):29 self.selenium.wait_until_page_contains_element(locator)30 self.selenium.wait_until_element_is_visible(locator)31 @keyword(name='Wait Until Input Field Is Enable')32 def wait_until_input_field_is_enable(self, locator):33 self.selenium.wait_until_page_contains_element(locator)34 self.selenium.wait_until_element_is_visible(locator)35 self.selenium.wait_until_element_is_enabled(locator)36 @keyword(name='Wait Until Profile Page Is Opened')37 def wait_until_profile_page_is_opened(self):38 editPersonalInfoButton = self.get_locator('editPersonalInfoButton')39 self.selenium.wait_until_element_is_visible(editPersonalInfoButton, 3)40 @keyword(name='Wait Until List Page Is Opened')41 def wait_until_list_page_is_opened(self):42 self.selenium.wait_until_element_is_visible("//*[@class='ProfileNav-item ProfileNav-item--lists is-active']")43 self.selenium.wait_until_element_is_visible("//*[@class='ListCreationModule module']//*[text()='建立列表']")44 @keyword(name='Wait Until Profile Is Saved')45 def wait_until_profile_is_saved(self):46 closeModalButton = self.get_locator('closePersonalInfoEditModalButton')47 self.selenium.wait_until_page_does_not_contain_element(closeModalButton, 3)48 addAvaterButton = self.get_locator('addAvaterButton')49 self.selenium.wait_until_page_does_not_contain_element(addAvaterButton, 3)50 @keyword(name="Login With User Id")51 def login_with_user_id(self):52 try:53 loginWarningMessage = self.builtIn.get_variable_value('${loginWarningMessage}')54 self.selenium.wait_until_element_is_visible(loginWarningMessage)55 except:56 userId = self.builtIn.get_variable_value('${userId}')57 userPassword = self.builtIn.get_variable_value('${userPassword}')...

Full Screen

Full Screen

main.py

Source:main.py Github

copy

Full Screen

...18 self.config.read("config.cfg")19 self.__get_credential()20 self.web = WebLibrary()21 self.web.open_browser(self.config.get("sign in", "url"))22 self.web.wait_until_element_is_visible(self.config.get("sign in", "email"))23 def __get_credential(self):24 password = get_password(self.config.get("sign in", "url"), self.config.get("sign in", "username"))25 return password26 def __message(self, message):27 self.user32.MessageBoxW(None, message, u"Qandle", 0)28 def login(self):29 self.web.input_text_by_xpath(self.config.get("sign in", "email"), self.config.get("sign in", "username"))30 self.web.input_password_by_xpath(self.config.get("sign in", "password"), self.__get_credential())31 self.web.click_element_by_xpath(self.config.get("sign in", "signin"))32 self.web.wait_until_element_is_visible(self.config.get("left pane", "username"))33 def clock_in(self):34 self.web.wait_until_element_is_visible(self.config.get("clock tile", "clock-in"))35 self.web.click_element_by_xpath(self.config.get("clock tile", "clock-in"))36 # self.__message("User successfully clocked in")37 self.clocked = True38 def clock_out(self):39 self.web.wait_until_element_is_visible(self.config.get("clock tile", "clock-out"))40 self.web.click_element_by_xpath(self.config.get("clock tile", "clock-out"))41 self.web.wait_until_element_is_visible(self.config.get("clock tile", "clock-out_confirmation"))42 self.web.click_element_by_xpath(self.config.get("clock tile", "clock-out_confirmation"))43 # self.__message("User successfully clocked out")44 self.clocked = True45 def log_out(self):46 if not self.clocked:47 action = "in" if args.clock_in else "out"48 self.__message(u"User have already clocked {}".format(action))49 try:50 self.web.wait_until_element_is_visible(self.config.get("logout", "logout_arrow"))51 self.web.click_element_by_xpath(self.config.get("logout", "logout_arrow"))52 self.web.wait_until_element_is_visible(self.config.get("logout", "logout"))53 self.web.click_element_by_xpath(self.config.get("logout", "logout"))54 finally:55 self.web.close_browser()56if __name__ == "__main__":57 qandle = Qandle()58 qandle.login()59 try:60 if args.clock_in:61 qandle.clock_in()62 elif args.clock_out:63 qandle.clock_out()64 finally:...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run robotframework-appiumlibrary automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful