Rohith1324
Board Regular
- Joined
- Feb 27, 2018
- Messages
- 114
Hi All,
Below is the script I'm running but "wait time" is giving me issues...when the webpage is loading fast...the script is getting executed successfully....but when it is exceeding the wait time then it is throwing an exception. ( it is very difficult to set one fixed time as the Web portal response is fluctuating )
Do we have any option to have the wait time assigned until the system responds. - Please help.
Below is the script I'm running but "wait time" is giving me issues...when the webpage is loading fast...the script is getting executed successfully....but when it is exceeding the wait time then it is throwing an exception. ( it is very difficult to set one fixed time as the Web portal response is fluctuating )
Do we have any option to have the wait time assigned until the system responds. - Please help.
VBA Code:
For Each C In Range("A6:A" & Cells(Rows.Count, "A").End(xlUp).Row).Cells
bot.Wait 2000
bot.FindElementByXPath("//*[@id='createNewForm']/div[3]/div/div/button/span[1]").Click
bot.Wait 500
bot.FindElementByXPath("//*[@id='createNewForm']/div[3]/div/div/div/ul/li[" & C.Offset(0, 1).Value & "]/a/span[1]").Click
bot.Wait 1000
bot.FindElementByXPath("//*[@id='createNewForm']/div[4]/div/div/button/span[1]").Click
bot.FindElementByXPath("//*[@id='createNewForm']/div[4]/div/div/div/ul/li[" & C.Offset(0, 3).Value & "]/a/span[1]").Click
bot.Wait 1000
bot.FindElementByXPath("//*[@id='createNewForm']/div[5]/div/div/button/span[1]").Click
bot.FindElementByXPath("//*[@id='createNewForm']/div[5]/div/div/div/ul/li[" & C.Offset(0, 5).Value & "]/a/span[1]").Click
bot.FindElementByXPath("//*[@id='custName']").SendKeys C.Offset(0, 6).Value
bot.Wait 1000
bot.FindElementByXPath("//div[@class='ui-grid-cell ng-scope ui-grid-coluiGrid-000M']").ClickDouble
bot.Wait 200
bot.FindElementByXPath("//*[@id='cpoNo']").SendKeys C.Offset(0, 7).Value
bot.Wait 200
bot.FindElementByXPath("//*[@id='reqDesc']").SendKeys C.Offset(0, 8).Value
If IsEmpty(C.Offset(0, 9).Value) = True Then
bot.FindElementByXPath("//*[@id='main']/div[2]").ScrollIntoView
Else
bot.FindElementById("uploadFileBtn").SendKeys C.Offset(0, 9).Value
End If
bot.FindElementByXPath("//*[@id='createNewForm']/div[15]").ScrollIntoView
If IsEmpty(C.Offset(0, 10).Value) = True Then
bot.FindElementByXPath("//*[@id='main']/div[2]").ScrollIntoView
Else
bot.FindElementByXPath("//*[@id='createNewForm']/div[13]/div/div[5]/div[1]/div/input[2]").Click
bot.FindElementById("uploadFileBtn_duplicate").SendKeys C.Offset(0, 10).Value
End If
bot.FindElementByXPath("//*[@id='main']/div[2]").ScrollIntoView
bot.SendKeys bot.Keys.Tab
bot.FindElementByXPath("//*[@id='createFormsubmit']").Click
bot.Wait 7000
Set ele = bot.FindElementByXPath("//*[@id='statusModal2']/div/div/div[2]/p")
C.Offset(0, 11).Value = ele.Text
bot.FindElementByXPath("//*[@id='statusModal2']/div/div/div[3]/a").Click
Next C
MsgBox "All the work ID's are submitted Successfully"
End Sub