Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] 26.11.2024: fix xpathes because uploading videos failed. #177

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Vladddd46
Copy link

I had troubles in uploading new videos, so i debugged the library and changed 2 xpathes because they were wrong. I suppose they are outdated. Also i commented 2 lines of code, which failed.

I did not dive deep in the logic and just made fixes so it works.

Comment on lines 752 to 755
tmp = "/html/body/div[1]/div/div[2]/div[2]/div/div/div/div/div[3]/div/div[2]/div[10]/button[1]"
post = WebDriverWait(driver, config["implicit_wait"]).until(
EC.element_to_be_clickable(
(By.XPATH, config["selectors"]["upload"]["post"])
(By.XPATH, tmp) # config["selectors"]["upload"]["post"] was instead of tmp
Copy link

@lavanphat lavanphat Oct 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should change value in config file instead of tmp variable and use this value //button[@data-e2e="post_video_button"]

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lavanphat fixed

Comment on lines 767 to 769
tmp1 = "/html/body/div[6]/div/div/div[3]/button[2]"
post_confirmation = EC.presence_of_element_located(
(By.XPATH, config["selectors"]["upload"]["post_confirmation"])
(By.XPATH, tmp1) # config["selectors"]["upload"]["post_confirmation"] was instead of tmp1
Copy link

@lavanphat lavanphat Oct 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same above comment, you should change value in config file instead of tmp variable

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lavanphat fixed

Copy link

@phatlv-slz phatlv-slz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -55,8 +55,8 @@ user_agent = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTM
duet = "//label[.='Duet']/following-sibling::div/input"
stitch = "//label[.='Stitch']/following-sibling::div/input"

post = "//button[contains(@class, 'TUXButton--primary')]"
post_confirmation = "//div[contains(text(), 'Your video has been uploaded')]"
post = "//*[@id=\"root\"]/div/div[2]/div[2]/div/div/div/div/div[3]/div/div[2]/div[10]/button[1]"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is too fragile of an xpath

@wkaisertexas
Copy link
Owner

wkaisertexas commented Nov 4, 2024

LGTM

Did you build and test these changes locally? What did you do to know that it looks good to you?

@phatlv-slz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants