Idassamed Posted August 13, 2018 Author Report Posted August 13, 2018 26 minutes ago, former said: As per understanding: User login into site. Searching other users in the search bar. If user didn't find, still need to show error like "user not find" and continue to other search. Nevu search chesinapudu, User session active lo vunte you can show both error message and Search bar again. The site throws an error and the code needs to continue with the search ignoring the error displayed for a bad search. Quote
Amrita Posted August 13, 2018 Report Posted August 13, 2018 8 minutes ago, Idassamed said: I am searching for a user, that too one at a time. The website needs to go and fetch the user, if a user is not found, the portal displays an error saying " No results found, refine your search" Now the issue is, my code stops at this error because when a valid user is returned, the result for the searched user contains a few links related to that user and I have to click those links. But when the user is not found, the code is searching for those links and those links are not found. I need the code to go look for the links only when a valid user is returned and when a bad search occurs, the code should ignore the error and continue with the search. When you get valid user info (list) have if condition for calling code for links if valid user returned list size >0. Error messages display ayite code will not enter that block so will not search. I am sure you might have explored this. Did i miss something? Quote
former Posted August 13, 2018 Report Posted August 13, 2018 9 minutes ago, Idassamed said: I am searching for a user, that too one at a time. The website needs to go and fetch the user, if a user is not found, the portal displays an error saying " No results found, refine your search" Now the issue is, my code stops at this error because when a valid user is returned, the result for the searched user contains a few links related to that user and I have to click those links. But when the user is not found, the code is searching for those links and those links are not found. I need the code to go look for the links only when a valid user is returned and when a bad search occurs, the code should ignore the error and continue with the search. You need one more cond between search results and display the links. If user found display the links other wise Give bad search in the same search page. follow @Amrita latest message. Quote
former Posted August 13, 2018 Report Posted August 13, 2018 2 minutes ago, Amrita said: When you get valid user info (list) have if condition for calling code for links if valid user returned list size >0. Error messages display ayite code will not enter that block so will not search. I am sure you might have explored this. Did i miss something? +111 Quote
fake_Bezawada Posted August 13, 2018 Report Posted August 13, 2018 On 8/11/2018 at 2:49 AM, vendettaa said: I have idea on this but am not into testing andhulo testing emundhi neeku development lo User batti roles vuntayi and based on that some links open or access vunda koodadu alanti scenario ne idhi kooda Quote
fake_Bezawada Posted August 13, 2018 Report Posted August 13, 2018 On 8/11/2018 at 2:49 AM, Idassamed said: Website ni automate cheyyali, User search chesthunna, if a user just not in the database, oka error display avuddhi, a error capture chesi next user ni search cheyyali. Users ni oka list lo petta, using a for loop, I am iterating over the list. Aa lost lo valid and invalid users unnaru. bro nuvvu cheppedi some how selenium related nee script tho cheyyali kadhaa poni behave framework cucumber anukundham andhulo ayna web driver vaadalsindhe kadha Quote
fake_Bezawada Posted August 13, 2018 Report Posted August 13, 2018 3 hours ago, Idassamed said: User login is fine, this is after logging into the website, where I am searching for a user and the page throws an error. As far as user validation is concerned, the search string is compared against the stored values in a database. search box lo auto fill function from javascript side which makes ajax calls and fetch json response of users list andhulo lekapothe no results found vastadi adhe ga nuvvu cheppe use case Quote
Idassamed Posted August 13, 2018 Author Report Posted August 13, 2018 1 minute ago, fake_Bezawada said: bro nuvvu cheppedi some how selenium related nee script tho cheyyali kadhaa poni behave framework cucumber anukundham andhulo ayna web driver vaadalsindhe kadha Yeah, adho okati. Nenu Selenium with Python vaduthunna. Logic will be the same irrespective of the language and framework. Quote
Idassamed Posted August 13, 2018 Author Report Posted August 13, 2018 Just now, fake_Bezawada said: search box lo auto fill function from javascript side which makes ajax calls and fetch json response of users list andhulo lekapothe no results found vastadi adhe ga nuvvu cheppe use case Yeah. Aa result capture cheyyali, oka vela error vasthe search continue cheyyali. Quote
fake_Bezawada Posted August 13, 2018 Report Posted August 13, 2018 15 minutes ago, Idassamed said: The site throws an error and the code needs to continue with the search ignoring the error displayed for a bad search. exception handling try cheyyi bro success vi anni oka list lo fail aynavi inko list lo pettuko Quote
fake_Bezawada Posted August 13, 2018 Report Posted August 13, 2018 2 minutes ago, Idassamed said: Yeah, adho okati. Nenu Selenium with Python vaduthunna. Logic will be the same irrespective of the language and framework. idhi nuvvu mundhu cheppalsina point python lo evadu cheyaledu untill unless selenium is used Quote
fake_Bezawada Posted August 13, 2018 Report Posted August 13, 2018 naaku idea ledu selenium peddaga but nee case lo exception handling chesuko saripotadi Quote
fake_Bezawada Posted August 13, 2018 Report Posted August 13, 2018 https://stackoverflow.com/questions/11306908/python-continue-looping-after-exception idhigo ila proper ga handle chesuko cheers Quote
Idassamed Posted August 13, 2018 Author Report Posted August 13, 2018 2 minutes ago, fake_Bezawada said: exception handling try cheyyi bro success vi anni oka list lo fail aynavi inko list lo pettuko Thanks baa, will give it a try. Quote
fake_Bezawada Posted August 13, 2018 Report Posted August 13, 2018 Just now, Idassamed said: Thanks baa, will give it a try. ledha code PM cheyyi ledha stack trace post cheyyi nenu cheptha ekkada handle cheyyalo Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.