@@ -43,15 +43,42 @@ def click_on_link(self, link_id):
4343
4444 def loop_through_link_traversal (self , print_statement , link_list , assertion_list ):
4545 """this method will be loop through all the list links"""
46+ import time
47+
48+ # Define the maximum number of retries
49+ max_retries = 3
50+
4651 i = 0
4752 while i < len (link_list ):
4853 print (print_statement [i ])
49- title = self .click_on_link (link_list [i ])
50- try :
51- assert title == assertion_list [i ], f"Expected page title { assertion_list [i ]} but got { title } "
52- except AssertionError :
53- print (f"Assertion Error occurred! for { assertion_list [i ]} \n " )
54- i = i + 1
54+ title = None
55+ try_count = 0
56+
57+ # Attempt the operation up to max_retries times
58+ while try_count < max_retries :
59+ try :
60+ title = self .click_on_link (link_list [i ])
61+ self .wait_for_ajax ()
62+ assert title == assertion_list [i ], f"Expected page title { assertion_list [i ]} but got { title } "
63+ break # If successful, break out of the retry loop
64+ except Exception as e :
65+ # If an error occurs, print the error message
66+ print (f"Error occurred: { e } " )
67+
68+ # Increment retry count
69+ try_count += 1
70+
71+ # If maximum retries reached, raise an error
72+ if try_count == max_retries :
73+ print (f"Failed after { max_retries } attempts for link: { link_list [i ]} " )
74+ break # Break out of the retry loop
75+
76+ # Wait for a few seconds before retrying
77+ time .sleep (3 )
78+
79+ # Move to the next link
80+ i += 1
81+
5582
5683 def click_on_btn (self , link_id ):
5784 """this method will execute multiple backup restore tab documentation"""
@@ -204,20 +231,20 @@ def driver_and_integration_link(self):
204231 # link name for all the Drivers and Integration link
205232 arangodb_java_driver = '//*[@id="documentation"]/div/div[5]/ul/li[1]/a'
206233 arangojs_java_script = '//*[@id="documentation"]/div/div[5]/ul/li[2]/a'
207- arangodb_php = '//*[@id="documentation"]/div/div[5]/ul/li[3]/a'
208- arangodb_go_driver = '//*[@id="documentation"]/div/div[5]/ul/li[4]/a'
209- arangodb_spring_data = '//*[@id="documentation"]/div/div[5]/ul/li[5]/a'
210- arangodb_spark_connector = '//*[@id="documentation"]/div/div[5]/ul/li[6]/a'
234+ arangodb_go_driver = '//*[@id="documentation"]/div/div[5]/ul/li[3]/a'
235+ arangodb_spring_data = '//*[@id="documentation"]/div/div[5]/ul/li[4]/a'
236+ arangodb_spark_connector = '//*[@id="documentation"]/div/div[5]/ul/li[5]/a'
237+ drivers_and_integration = '//*[@id="documentation"]/div/div[5]/ul/li[6]/a'
211238
212239 Official_print_statement = ['Checking ArangoDB Java Driver link \n ' ,
213240 'Checking ArangoJS - Javascript Driver link \n ' ,
214- 'Checking ArangoDB-PHP link \n ' ,
215- 'Checking ArangoDB Go Driver link \n ' ,
241+ 'Checking ArangoDB Go driver link \n ' ,
216242 'Checking Go to ArangoDB Spring Data page link \n ' ,
217- 'Checking Go to ArangoDB Spark Connections page link\n ' ]
243+ 'Checking Go to ArangoDB Spark Connections page link \n ' ,
244+ 'Checking Go to Drivers and Integration start page link\n ' ]
218245
219246 drivers_and_integration = [arangodb_java_driver , arangojs_java_script , arangodb_php , arangodb_go_driver ,
220- arangodb_spring_data , arangodb_spark_connector ]
247+ arangodb_spring_data , drivers_and_integration ]
221248
222249 driver_integration_assertion_check = ['ArangoDB Java driver | ArangoDB Documentation' ,
223250 'ArangoDB Node.js driver | ArangoDB Documentation' ,
0 commit comments