Тёмный

Handling Select/DropDown | Playwright - Part 9 

LetCode with Koushik
Подписаться 34 тыс.
Просмотров 25 тыс.
50% 1

Опубликовано:

 

26 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 58   
@彭偉倫-b3g
@彭偉倫-b3g 2 года назад
thanks for your teaching! The think path of using selectoption really help me a lot.
@letcode
@letcode 2 года назад
Welcome 😊
@webtestingui7187
@webtestingui7187 2 года назад
Hi Kaushik I have installed jest cli but when I run the jest followed the test case file name then it doesn't run. could you please help me with this I get exception as "Invalid transformer module"
@letcode
@letcode 2 года назад
Hi no need to use jest. Refer this video ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-qoG5gidhj_A.html
@abhedpatil
@abhedpatil Год назад
I'm kind of struggling to validate the dropdown values. When i used TextContext - all dropdown values are returned. When i follow your strategy i.e. const selectedvalue = await this.page.$eval(locator, element => element.value); The resulted returned is : selected value for priority is : 1: f9a4b37b-6fad-47ae-82ba-3dfaba191e12.. how do i validate using actual text ?
@abhedpatil
@abhedpatil Год назад
found the solution: async validateDropdown(locator: string, text: string) { const actualvalue: string = text; const selectedvalue = await this.page.$eval( locator, (element) => { return element.selectedOptions[0].text; } ); console.log(`selected value for priority is : ${selectedvalue}`); expect(actualvalue).toEqual(selectedvalue); }
@letcode
@letcode Год назад
Great 😃
@safdarsohail
@safdarsohail 3 года назад
you are doing great jobs !!
@letcode
@letcode 3 года назад
Thank you 😊
@feedingjuan7122
@feedingjuan7122 Год назад
Hi, How can I include the CSS and XPath on the inspect element?
@letcode
@letcode Год назад
Hi. Either one.
@sukhwindersingh-kz8zd
@sukhwindersingh-kz8zd 2 года назад
Thank you for sharing the info, however is there workaround to handle the select2 not select as I am getting err in playwright i.e Element is not a element
@letcode
@letcode 2 года назад
You can use this concept ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-1RUMsrYXUcA.html
@sukhwindersingh-kz8zd
@sukhwindersingh-kz8zd 2 года назад
@@letcode i appreciate your help very much. It solve my concern.
@Aowek955
@Aowek955 Год назад
Hi Koushik, How can I handle dynamic angular dropdown using Page object model ? Could you please showcase an example?
@letcode
@letcode Год назад
Hi, you can refer to this ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-1RUMsrYXUcA.html
@early_testing
@early_testing 2 года назад
Thanks Koushik :)
@letcode
@letcode 2 года назад
Welcome 😊
@Kittycat-pg1du
@Kittycat-pg1du 2 года назад
hi, I am trying to figure out how to code the auto suggestive dropdown for location. I am not able to inspect the list because it disappears when I right click on it, I am using Javascript and Playwright
@letcode
@letcode 2 года назад
Hi, in this video I discussed that pls check. ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-udkFaDvWYgA.html
@arutchelvana33
@arutchelvana33 2 года назад
Hi Koushik, In Angular application, this is handled as , I tried using this select, But not working. So would like to know, How do we handle the select option in angular based , cases. Now we are using a normal click on the arrow and select the option using another click. Thank you for your support....
@letcode
@letcode 2 года назад
Hi, this might help ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-1RUMsrYXUcA.html
@azimadayani2379
@azimadayani2379 2 года назад
Hi kaushik Could you please provide link to sample framework. I kept searching but I’m unable to locate
@letcode
@letcode 2 года назад
ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-ELAp41NV13E.html
@azimadayani2379
@azimadayani2379 2 года назад
How do you verify table is sorted in ascending or descending order when clicking on title for example date.
@letcode
@letcode 2 года назад
Get all the values store in an array, click on the title, get the value store in an array. Compare both the array.
@gello2777
@gello2777 2 года назад
Hi Koushik. how to deal with frames in this case. eg . like "page.$eval" is fine however "frame.$eval" is saying its not a function.
@letcode
@letcode 2 года назад
Hi, i didn't try eval with in frame. I'll check and let u know.
@maranbalu81
@maranbalu81 2 года назад
Hello bro, I wanted to fetch the selected option from a drop-down using playwright-java. Would you be able to help me with it.
@letcode
@letcode 2 года назад
I don't have any example bro, concept is same. You can refer the Java playwright documents
@gunarangu1864
@gunarangu1864 Год назад
how to handle dropdowns if they are not created using select?
@letcode
@letcode Год назад
ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-1RUMsrYXUcA.html
@MiguelAngel-ou4zm
@MiguelAngel-ou4zm 2 года назад
Will last scenario (selected option) work when wanting to know if an option is present in a dropdown, not selected? btw, awesome explanation.
@letcode
@letcode 2 года назад
Yes it will, thank you 😊
@ramachandranv3902
@ramachandranv3902 3 года назад
CheckBox/Radio button not been used? can you help me with that.
@letcode
@letcode 3 года назад
Ok bro ☺️, will make a video on it. Thanks for asking 😊
@ramachandranv3902
@ramachandranv3902 3 года назад
@@letcode thanks bro
@jackweaver5840
@jackweaver5840 2 года назад
Hi, can you explain how we could get all of the values inner texts in the dropdown? And do assertions? If a certain value exists or does not exist in the dropdown? I suppose it is of the use of an array to go over the length, then create a variable to get the inner texts of all what is in the array, then we can do the expect to contain or not to contain a certain value right?
@letcode
@letcode 2 года назад
Hi, Yes correct, you can try the same, if there is any issue do let me know
@saivamshikrishnapeddammala8678
@saivamshikrishnapeddammala8678 2 года назад
Hi Koushik, Thanks for the video. How to use dynamic xpath like $"//a[contains(@aria-label,'{AppName}')]" Based on the variable I have passed, Need to select webelement
@letcode
@letcode 2 года назад
You can use backticks, Eg. Page.locator(`//@[contains(@aria-label, ${varname}`)
@waleedabbasi9218
@waleedabbasi9218 2 года назад
Can u help me How to Select Edit icons?
@letcode
@letcode 2 года назад
Is it svg element?
@AliKhan-wm5lt
@AliKhan-wm5lt 2 года назад
Hi Koushik, Is there a way to select an option/text from the dropdown with partial text/value?
@letcode
@letcode 2 года назад
I have to check bro 🙂, will let u know.
@AliKhan-wm5lt
@AliKhan-wm5lt 2 года назад
@@letcode sure thank you
@AliKhan-wm5lt
@AliKhan-wm5lt 2 года назад
@@letcode Any luck?
@shravaniedla83
@shravaniedla83 2 года назад
@@AliKhan-wm5lt Im looking for partial text match too.
@letcode
@letcode 2 года назад
If you don't use regex it will select by first option in partial match bro.
@gentrithoxha7797
@gentrithoxha7797 3 года назад
can you show us how to use this feature to fill date picker
@letcode
@letcode 3 года назад
Sure, I'll make a video
@AI_mod
@AI_mod 2 года назад
Use the page.fill option.
@prasadverma4794
@prasadverma4794 3 года назад
Hi Koushik, how to handle a dropdown with input tag. Thank you
@letcode
@letcode 3 года назад
If I'm not wrong u mean to ask select tag ? If so then it's like normal click action, we'll click the element may be button or div. Then of see the option we can click based on the unique selector.
@prasadverma4794
@prasadverma4794 3 года назад
@@letcode in my application we have dropdown with input tag instead of select.
@letcode
@letcode 3 года назад
Ok yes, same as I said in the previous comment. U can click the input and then select the value.
@prasadverma4794
@prasadverma4794 3 года назад
@@letcode ok thank-you
@prasadverma4794
@prasadverma4794 3 года назад
@@letcode Hi Koushik, I'm trying to select value from a dropdown having tag as input. As suggested by you I clicked on the element and got all the elements of values using page.$$ option. In next step I'm trying to get the textcontent for each element to compare it against value Im looking for. But it is not returning any text. Can you help me on this. Thank you
Далее
Window Handling | Playwright - Part 10
20:58
Просмотров 16 тыс.
진 (Jin) 'I'll Be There' Official MV
03:15
Просмотров 9 млн
Frames | Playwright - Part 11
18:50
Просмотров 10 тыс.
Why Vitest Is Better Than Jest
13:13
Просмотров 137 тыс.
Introduction to Jest Testing | JavaScript Unit Tests
25:30
Find Multiple Elements | Playwright - Part 12
17:53
Просмотров 17 тыс.
진 (Jin) 'I'll Be There' Official MV
03:15
Просмотров 9 млн