pearlxcore / Shopee-Autobuy-Bot

Automation program to assist users with purchasing products on the Shopee website.
80 stars 44 forks source link

Having issues with warming up bot on normal mode to test out checkout #24

Closed danielaniq28 closed 1 year ago

danielaniq28 commented 1 year ago

Click 'Buy Now'. [10:15:41] Current element : BuyNowButton (//button[contains(@class, 'btn btn-solid-primary btn--l') and contains(text(), 'buy now')]) An error occurred on line at OpenQA.Selenium.Support.UI.DefaultWait1.ThrowTimeoutException(String exceptionMessage, Exception lastException) at OpenQA.Selenium.Support.UI.DefaultWait1.Until[TResult](Func2 condition, CancellationToken token) at OpenQA.Selenium.Support.UI.DefaultWait1.Until[TResult](Func`2 condition) at Shopee_Autobuy_Bot.SeleniumService.WaitUrlContainString(String text) at Shopee_Autobuy_Bot.Services.AutoBuyService.CartPage(String buyMode): Timed out after 5 seconds

pearlxcore commented 1 year ago

Use browser’s inspect element. Copy xpath for ‘Buy now’ button. Paste in element editor.

pojanpo commented 1 year ago

[15:27:03] Product page loaded. [15:27:03] Current element : () An error occurred on line at Shopee_Autobuy_Bot.Services.AutoBuyService.IsProductAvailable() at Shopee_Autobuy_Bot.Services.AutoBuyService.BuyProduct(String buyMode) at Shopee_Autobuy_Bot.Services.AutoBuyService.ProductPage(String buyMode): Object reference not set to an instance of an object.

pearlxcore commented 1 year ago

[15:27:03] Product page loaded. [15:27:03] Current element : () An error occurred on line at Shopee_Autobuy_Bot.Services.AutoBuyService.IsProductAvailable() at Shopee_Autobuy_Bot.Services.AutoBuyService.BuyProduct(String buyMode) at Shopee_Autobuy_Bot.Services.AutoBuyService.ProductPage(String buyMode): Object reference not set to an instance of an object.

Element already updated?

pojanpo commented 1 year ago

[15:27:03] Product page loaded. [15:27:03] Current element : () An error occurred on line at Shopee_Autobuy_Bot.Services.AutoBuyService.IsProductAvailable() at Shopee_Autobuy_Bot.Services.AutoBuyService.BuyProduct(String buyMode) at Shopee_Autobuy_Bot.Services.AutoBuyService.ProductPage(String buyMode): Object reference not set to an instance of an object.

Element already updated?

how to do it?

danielaniq28 commented 1 year ago

Use browser’s inspect element. Copy xpath for ‘Buy now’ button. Paste in element editor.

Still having same issue even after updating xpath to //*[@id="main"]/div/div[2]/div[1]/div[1]/div/div/section[1]/section[2]/div/div[5]/div/div/button[2]

pojanpo commented 1 year ago

[15:53:07] Select 'Cash Payment at Convenience Stores'. [15:53:07] Current element : CheckOutButton (//*[@id="main"]/div/div[2]/div/div/div[3]/section/div[7]/button[4]/span) An error occurred on line at OpenQA.Selenium.WebDriver.UnpackAndThrowOnError(Response errorResponse, String commandToExecute) at OpenQA.Selenium.WebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters) at OpenQA.Selenium.WebDriver.FindElement(String mechanism, String value) at OpenQA.Selenium.By.<.ctor>b__11_0(ISearchContext context) at OpenQA.Selenium.By.FindElement(ISearchContext context) at OpenQA.Selenium.WebDriver.FindElement(By by) at Shopee_Autobuy_Bot.SeleniumService.SelectElement(By locator) at Shopee_Autobuy_Bot.Services.AutoBuyService.ChangePaymentMethod() at Shopee_Autobuy_Bot.Services.AutoBuyService.CheckoutPage(): invalid selector: Unable to locate an element with the xpath expression /html/body/div[1]/div/div[2]/div/div[2]/div[4]/div[1]/div/div[2]/div/div/div[1]/div[2]/div/div/div[2 because of the following error: SyntaxError: Failed to execute 'evaluate' on 'Document': The string '/html/body/div[1]/div/div[2]/div/div[2]/div[4]/div[1]/div/div[2]/div/div/div[1]/div[2]/div/div/div[2' is not a valid XPath expression. (Session info: chrome=118.0.5993.70) [15:53:07] Select 'Cash Payment at Convenience Stores'. [15:53:07] Job aborted.

iam stuck at place order page

pearlxcore commented 1 year ago

[15:53:07] Select 'Cash Payment at Convenience Stores'. [15:53:07] Current element : CheckOutButton (//*[@id="main"]/div/div[2]/div/div/div[3]/section/div[7]/button[4]/span) An error occurred on line at OpenQA.Selenium.WebDriver.UnpackAndThrowOnError(Response errorResponse, String commandToExecute) at OpenQA.Selenium.WebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters) at OpenQA.Selenium.WebDriver.FindElement(String mechanism, String value) at OpenQA.Selenium.By.<.ctor>b__11_0(ISearchContext context) at OpenQA.Selenium.By.FindElement(ISearchContext context) at OpenQA.Selenium.WebDriver.FindElement(By by) at Shopee_Autobuy_Bot.SeleniumService.SelectElement(By locator) at Shopee_Autobuy_Bot.Services.AutoBuyService.ChangePaymentMethod() at Shopee_Autobuy_Bot.Services.AutoBuyService.CheckoutPage(): invalid selector: Unable to locate an element with the xpath expression /html/body/div[1]/div/div[2]/div/div[2]/div[4]/div[1]/div/div[2]/div/div/div[1]/div[2]/div/div/div[2 because of the following error: SyntaxError: Failed to execute 'evaluate' on 'Document': The string '/html/body/div[1]/div/div[2]/div/div[2]/div[4]/div[1]/div/div[2]/div/div/div[1]/div[2]/div/div/div[2' is not a valid XPath expression. (Session info: chrome=118.0.5993.70) [15:53:07] Select 'Cash Payment at Convenience Stores'. [15:53:07] Job aborted.

iam stuck at place order page

you need to update the xpath in element editor

pearlxcore commented 1 year ago

Use browser’s inspect element. Copy xpath for ‘Buy now’ button. Paste in element editor.

Still having same issue even after updating xpath to //*[@id="main"]/div/div[2]/div[1]/div[1]/div/div/section[1]/section[2]/div/div[5]/div/div/button[2]

just simply update xpath from repo. if some xpath not working, update manually image

pojanpo commented 1 year ago

[22:15:17] Click 'Check Out'. [22:15:19] Select 'Cash Payment at Convenience Stores'. [22:15:19] Select '7-Eleven'. [22:15:20] Click 'Select Voucher'. [22:15:26] Current element : SelectShopeeVoucherButton (//*[@id="main"]/div/div[2]/div/div[2]/div[3]/div[1]/div[2]/button) An error occurred on line at OpenQA.Selenium.Support.UI.DefaultWait1.ThrowTimeoutException(String exceptionMessage, Exception lastException) at OpenQA.Selenium.Support.UI.DefaultWait1.Until[TResult](Func2 condition, CancellationToken token) at OpenQA.Selenium.Support.UI.DefaultWait1.Until[TResult](Func`2 condition) at Shopee_Autobuy_Bot.SeleniumService.WaitElementClickable(By locator) at Shopee_Autobuy_Bot.Services.AutoBuyService.RedeemShopVoucher() at Shopee_Autobuy_Bot.Services.AutoBuyService.PlaceOrder() at Shopee_Autobuy_Bot.Services.AutoBuyService.CheckoutPage(): Timed out after 5 seconds [22:15:26] Select 'Cash Payment at Convenience Stores'. [22:15:26] Select '7-Eleven'. [22:15:27] Click 'Select Voucher'. [22:15:32] Job aborted.

How to select a voucher,i can open voucher container but cannot select

pojanpo commented 1 year ago

why select varation not function, "....."not available.

pojanpo commented 1 year ago

Screenshot 2023-10-24 230101

why is there a limit, how do I put XPath if there is a limit?

pearlxcore commented 1 year ago

2.5.4.0